Wetterstation_Boris/include/mess_Ub.h

22 lines
477 B
C
Raw Normal View History

2023-05-18 12:10:48 +02:00
#include <Arduino.h>
ADC_MODE(ADC_VCC);
const float MinimalSpannung = 2.85;
float korectur = 9.2800899887514060742407199100112e-4;
char floatString[15] = {0};
float AKKU;
float getBattery()
{
#if (NOBATT == 1)
Serial.print("Batterie:\t\t 3.05 V\n");
return 3.05;
#endif
int Vcc = ESP.getVcc();
float VCC = Vcc * korectur ;
Serial.printf("Rohdaten: %d, ", Vcc);
dtostrf(VCC,7,2,floatString);
Serial.printf("Vcc: %s V\n", floatString);
return VCC;
}