Implementing a calibrated ESP32 ADC reading

This commit is contained in:
code8buster
2023-05-13 20:38:37 -04:00
committed by Thomas Göttgens
parent 508cdf6060
commit d11bcda292
3 changed files with 89 additions and 28 deletions

View File

@@ -3,9 +3,13 @@
#define GPS_RX_PIN 15 // per @der_bear on the forum, 36 is incorrect for this board type and 15 is a better pick
#define GPS_TX_PIN 13
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define BATTERY_PIN 35
#define ADC_CHANNEL ADC_GPIO35_CHANNEL
#define BATTERY_SENSE_SAMPLES 30
#define DEFAULT_VREF 1100
// ratio of voltage divider = 2.0 (R42=100k, R43=100k)
#define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage.
#define ADC_MULTIPLIER 2
#define I2C_SDA 21 // I2C pins for this board
#define I2C_SCL 22
@@ -19,4 +23,4 @@
#define LORA_DIO0 26 // a No connect on the SX1262 module
#define LORA_RESET 23
#define LORA_DIO1 33 // https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-3/18436
#define LORA_DIO2 32 // Not really used
#define LORA_DIO2 32 // Not really used