Updated volt pin name
This commit is contained in:
@ -274,7 +274,7 @@ BatteryVoltage::BatteryVoltage() {
|
||||
#if defined(ESP8266)
|
||||
pinMode(PIN_A0, INPUT);
|
||||
#else
|
||||
pinMode(PIN_A0, INPUT_PULLDOWN);
|
||||
pinMode(PIN_VOLT, INPUT_PULLDOWN);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -282,7 +282,7 @@ void BatteryVoltage::read() {
|
||||
// The analog pin can only handle 3.3V maximum voltage so we need to reduce
|
||||
// the voltage (from max 5V)
|
||||
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 ESP32 has an ADC range of 0-4095 and a maximum voltage of 3.3V
|
||||
|
10
src/main.hpp
10
src/main.hpp
@ -46,7 +46,7 @@ extern RunMode runMode;
|
||||
#define PIN_SCL D4
|
||||
#define PIN_DS D6
|
||||
#define PIN_LED 2
|
||||
// #define PIN_A0 A0
|
||||
#define PIN_VOLT PIN_A0
|
||||
#elif defined(ESP32C3)
|
||||
// Hardware config for ESP32-c3-mini, iSpindel hardware
|
||||
// ------------------------------------------------------
|
||||
@ -66,7 +66,7 @@ extern RunMode runMode;
|
||||
#define PIN_SCL 6
|
||||
#endif // JTAG_DEBUG
|
||||
#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
|
||||
// cannot use both. So we point LED to pin 8 which is not used.
|
||||
#define PIN_LED 8
|
||||
@ -83,7 +83,7 @@ extern RunMode runMode;
|
||||
#define PIN_SDA A17
|
||||
#define PIN_SCL A15
|
||||
#define PIN_DS A8
|
||||
#define PIN_A0 A2
|
||||
#define PIN_VOLT A2
|
||||
#define PIN_LED LED_BUILTIN
|
||||
#elif defined(ESP32LITE)
|
||||
// Hardware config for ESP32-lite, Floaty hardware
|
||||
@ -98,7 +98,7 @@ extern RunMode runMode;
|
||||
#define PIN_SDA A17
|
||||
#define PIN_SCL A19
|
||||
#define PIN_DS A3
|
||||
#define PIN_A0 A0
|
||||
#define PIN_VOLT A7
|
||||
#define PIN_VCC A5
|
||||
#define PIN_GND A18
|
||||
#define PIN_LED LED_BUILTIN
|
||||
@ -116,7 +116,7 @@ extern RunMode runMode;
|
||||
#define PIN_SCL D4
|
||||
#define PIN_DS D6
|
||||
#define PIN_LED LED_BUILTIN
|
||||
// #define PIN_A0 A4
|
||||
#define PIN_VOLT PIN_A0
|
||||
#endif
|
||||
|
||||
#if defined(USE_SERIAL_PINS) && defined(ESP32)
|
||||
|
Reference in New Issue
Block a user