mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Merge pull request #2164 from Snayler/dev
Fix Heltec Wireless Paper battery reading
This commit is contained in:
commit
c92cd219d1
2 changed files with 5 additions and 1 deletions
|
|
@ -11,6 +11,9 @@
|
|||
#ifndef PIN_ADC_CTRL // set in platformio.ini for Heltec Wireless Tracker (2)
|
||||
#define PIN_ADC_CTRL 37
|
||||
#endif
|
||||
#ifndef ADC_MULTIPLIER //default ADC multiplier
|
||||
#define ADC_MULTIPLIER 5.42
|
||||
#endif
|
||||
#define PIN_ADC_CTRL_ACTIVE LOW
|
||||
#define PIN_ADC_CTRL_INACTIVE HIGH
|
||||
|
||||
|
|
@ -88,7 +91,7 @@ public:
|
|||
|
||||
digitalWrite(PIN_ADC_CTRL, !adc_active_state);
|
||||
|
||||
return (5.42 * (3.3 / 1024.0) * raw) * 1000;
|
||||
return (ADC_MULTIPLIER * (3.3 / 1024.0) * raw) * 1000;
|
||||
}
|
||||
|
||||
const char* getManufacturerName() const override {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ build_flags =
|
|||
;-D PIN_BOARD_SCL=18 ; same GPIO as P_LORA_TX_LED
|
||||
-D PIN_USER_BTN=0
|
||||
-D PIN_VEXT_EN=45
|
||||
-D ADC_MULTIPLIER=8.4
|
||||
-D PIN_VBAT_READ=20
|
||||
-D PIN_ADC_CTRL=19
|
||||
-D SX126X_DIO2_AS_RF_SWITCH=true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue