working on T-Beam 0.7 VBAT reading

pull/72/head
Sottosistema W10 2021-09-14 22:55:01 +02:00
rodzic 43a9da194b
commit ab1efc0a84
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -366,7 +366,7 @@ void batt_read(){
BattVolts = axp.getBattVoltage()/1000;
InpVolts = axp.getVbusVoltage()/1000;
#elif T_BEAM_V0_7
BattVolts = ((float)analogRead(35) * 7.221 / 8192); // fixed thanks to Luca IU2FRL
BattVolts = ((float)analogRead(35) / 8192.0) * 2.0 * 3.3 * (1100.0 / 1000.0); // fixed thanks to Luca IU2FRL
#else
BattVolts = analogRead(35)*7.221/4096; // fixed thanks to Luca IU2FRL
#endif
@ -516,6 +516,12 @@ void sendTelemetryFrame() {
// + SETUP --------------------------------------------------------------+//
void setup(){
//#ifdef T_BEAM_V0_7
// adcAttachPin(35);
// adcStart(35);
// analogReadResolution(10);
//#endif
SPI.begin(SPI_sck,SPI_miso,SPI_mosi,SPI_ss); //DO2JMG Heltec Patch
Serial.begin(115200);