Updated volt pin name

This commit is contained in:
Magnus Persson
2022-11-10 19:42:44 +01:00
parent 6af0af57b8
commit d4ea1c9f98
2 changed files with 7 additions and 7 deletions

View File

@ -274,7 +274,7 @@ BatteryVoltage::BatteryVoltage() {
#if defined(ESP8266) #if defined(ESP8266)
pinMode(PIN_A0, INPUT); pinMode(PIN_A0, INPUT);
#else #else
pinMode(PIN_A0, INPUT_PULLDOWN); pinMode(PIN_VOLT, INPUT_PULLDOWN);
#endif #endif
} }
@ -282,7 +282,7 @@ void BatteryVoltage::read() {
// The analog pin can only handle 3.3V maximum voltage so we need to reduce // The analog pin can only handle 3.3V maximum voltage so we need to reduce
// the voltage (from max 5V) // the voltage (from max 5V)
float factor = myConfig.getVoltageFactor(); // Default value is 1.63 float factor = myConfig.getVoltageFactor(); // Default value is 1.63
int v = analogRead(PIN_A0); int v = analogRead(PIN_VOLT);
// An ESP8266 has a ADC range of 0-1023 and a maximum voltage of 3.3V // An ESP8266 has a ADC range of 0-1023 and a maximum voltage of 3.3V
// An ESP32 has an ADC range of 0-4095 and a maximum voltage of 3.3V // An ESP32 has an ADC range of 0-4095 and a maximum voltage of 3.3V

View File

@ -46,7 +46,7 @@ extern RunMode runMode;
#define PIN_SCL D4 #define PIN_SCL D4
#define PIN_DS D6 #define PIN_DS D6
#define PIN_LED 2 #define PIN_LED 2
// #define PIN_A0 A0 #define PIN_VOLT PIN_A0
#elif defined(ESP32C3) #elif defined(ESP32C3)
// Hardware config for ESP32-c3-mini, iSpindel hardware // Hardware config for ESP32-c3-mini, iSpindel hardware
// ------------------------------------------------------ // ------------------------------------------------------
@ -66,7 +66,7 @@ extern RunMode runMode;
#define PIN_SCL 6 #define PIN_SCL 6
#endif // JTAG_DEBUG #endif // JTAG_DEBUG
#define PIN_DS A3 #define PIN_DS A3
#define PIN_A0 A0 #define PIN_VOLT A0
// This should be the LED_BUILTIN, but that is also connected SDA (Gyro) so we // This should be the LED_BUILTIN, but that is also connected SDA (Gyro) so we
// cannot use both. So we point LED to pin 8 which is not used. // cannot use both. So we point LED to pin 8 which is not used.
#define PIN_LED 8 #define PIN_LED 8
@ -83,7 +83,7 @@ extern RunMode runMode;
#define PIN_SDA A17 #define PIN_SDA A17
#define PIN_SCL A15 #define PIN_SCL A15
#define PIN_DS A8 #define PIN_DS A8
#define PIN_A0 A2 #define PIN_VOLT A2
#define PIN_LED LED_BUILTIN #define PIN_LED LED_BUILTIN
#elif defined(ESP32LITE) #elif defined(ESP32LITE)
// Hardware config for ESP32-lite, Floaty hardware // Hardware config for ESP32-lite, Floaty hardware
@ -98,7 +98,7 @@ extern RunMode runMode;
#define PIN_SDA A17 #define PIN_SDA A17
#define PIN_SCL A19 #define PIN_SCL A19
#define PIN_DS A3 #define PIN_DS A3
#define PIN_A0 A0 #define PIN_VOLT A7
#define PIN_VCC A5 #define PIN_VCC A5
#define PIN_GND A18 #define PIN_GND A18
#define PIN_LED LED_BUILTIN #define PIN_LED LED_BUILTIN
@ -116,7 +116,7 @@ extern RunMode runMode;
#define PIN_SCL D4 #define PIN_SCL D4
#define PIN_DS D6 #define PIN_DS D6
#define PIN_LED LED_BUILTIN #define PIN_LED LED_BUILTIN
// #define PIN_A0 A4 #define PIN_VOLT PIN_A0
#endif #endif
#if defined(USE_SERIAL_PINS) && defined(ESP32) #if defined(USE_SERIAL_PINS) && defined(ESP32)