Skip to content

Commit 278833f

Browse files
author
jenkie
committed
Bugfix external voltage and current sensor
Use values from external sensor in debug message if activated
1 parent 6a9991e commit 278833f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Arduino_Pedelec_Controller/Arduino_Pedelec_Controller.ino

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,8 +1195,16 @@ void serial_debug(HardwareSerial* localSerial)
11951195
//now: data for Arduino Pedelec Configurator
11961196
//0:voltage 1:current 2:pasfactor*100 3:option-pin 4:poti 5:throttle 6: brake
11971197
localSerial->print(MY_F("---raw---"));
1198+
#ifndef USE_EXTERNAL_VOLTAGE_SENSOR
11981199
localSerial->print(analogRead_noISR(voltage_in)); Serial.print(MY_F(";"));
1200+
#else
1201+
localSerial->print(analogRead_noISR(external_voltage_in)); Serial.print(MY_F(";"));
1202+
#endif
1203+
#ifndef USE_EXTERNAL_CURRENT_SENSOR
11991204
localSerial->print(analogRead_noISR(current_in)); Serial.print(MY_F(";"));
1205+
#else
1206+
localSerial->print(analogRead_noISR(external_current_in)); Serial.print(MY_F(";"));
1207+
#endif
12001208
#ifdef SUPPORT_XCELL_RT
12011209
localSerial->print(pedaling); Serial.print(MY_F(";"));
12021210
#else

0 commit comments

Comments
 (0)