#define DC_CUR_LIMIT 15 // DC current limit in amps per motor. so 15 means it will draw 30A out of your battery. it does not disable motors, it is a soft current limit.
#define DELAY_IN_MAIN_LOOP 5 // in ms. default 5. it is independent of all the timing critical stuff. do not touch if you do not know what you are doing.
// Battery voltage calibration: connect power source. use multimeter to measure real voltage and write it to BAT_CALIB_REAL_VOLTAGE. enable DEBUG_SERIAL_USART3 and DEBUG_SERIAL_ASCII (and disconnect and disable CONTROL_NUNCHUCK) and watch UART on right sensor board cable. write value nr 5 to BAT_CALIB_ADC. make and flash firmware. you can verify voltage on UART debug value 6 (devide it by 100.0 to get calibrated voltage).
// ADC-calibration to cover the full poti-range: connect potis to left sensor board cable (0 to 3.3V) (do NOT use the red 15V wire in the cable!). enable DEBUG_SERIAL_USART3 and DEBUG_SERIAL_ASCII (and disconnect and disable CONTROL_NUNCHUCK) and watch UART on right sensor board cable. value1 == ADC1 and value2 == ADC2. write minimum and maximum poti position-values to ADC?_MIN and ADC?_MAX.
// left sensor board cable. keep cable short, use shielded cable, use ferrits, stabalize voltage in nunchuck, use the right one of the 2 types of nunchucks, add i2c pullups.
#if defined DEBUG_SERIAL_USART2 && defined CONTROL_ADC
#error CONTROL_ADC and DEBUG_SERIAL_USART2 not allowed. use DEBUG_SERIAL_USART3 instead.
#endif
#if defined DEBUG_SERIAL_USART2 && defined CONTROL_PPM
#error CONTROL_PPM and DEBUG_SERIAL_USART2 not allowed. use DEBUG_SERIAL_USART3 instead.
#endif
#if defined DEBUG_SERIAL_USART3 && defined CONTROL_NUNCHUCK
#error CONTROL_NUNCHUCK and DEBUG_SERIAL_USART3 not allowed. use DEBUG_SERIAL_USART2 instead.
#endif
#if defined CONTROL_PPM && defined CONTROL_ADC && defined CONTROL_NUNCHUCK || defined CONTROL_PPM && defined CONTROL_ADC || defined CONTROL_ADC && defined CONTROL_NUNCHUCK || defined CONTROL_PPM && defined CONTROL_NUNCHUCK
#error only 1 input method allowed. use CONTROL_PPM or CONTROL_ADC or CONTROL_NUNCHUCK.