[CODE] new ADC settings for voltage divider

This commit is contained in:
Jannik Beyerstedt 2018-07-31 10:32:37 +02:00
parent 77cae4847c
commit db9883ff16

View file

@ -34,8 +34,8 @@
#define DB_PASSWD "c2Vuc29yczpTZW5zb3JzLXcuaW5mbHV4QGhvbWU" // BasicAuth String #define DB_PASSWD "c2Vuc29yczpTZW5zb3JzLXcuaW5mbHV4QGhvbWU" // BasicAuth String
#if BOARD == BOARD_ESP32 #if BOARD == BOARD_ESP32
#define BATT_FULL 2812 // TODO: get actual value #define BATT_FULL 3600 // 3.6V VCC (4.3V Battery) TODO: get actual value
#define BATT_CUTOFF 2280 // TODO: get actual value #define BATT_CUTOFF 2300 // 2.3V VCC (3.0V Battery) TODO: get actual value
#else #else
#error "unsupported board chosen" #error "unsupported board chosen"
#endif #endif
@ -183,9 +183,8 @@ extern "C" void app_main() {
} }
// setup the adc for VCC measurement // setup the adc for VCC measurement
// TODO!
adc1_config_width(ADC_WIDTH_12Bit); adc1_config_width(ADC_WIDTH_12Bit);
adc1_config_channel_atten(ADC1_CHANNEL_0, ADC_ATTEN_11db); // 11dB ~ max 3.14V = 4069 adc1_config_channel_atten(ADC1_CHANNEL_0, ADC_ATTEN_0db); // or ADC_ATTEN_2_5db
/* GET VALUE SAMPLES */ /* GET VALUE SAMPLES */
// measure environmental data from si7021 // measure environmental data from si7021