22 lines
497 B
C
22 lines
497 B
C
#include <Arduino.h>
|
|
|
|
ADC_MODE(ADC_VCC);
|
|
|
|
const float MinimalSpannung = 2.85;
|
|
float korectur = 9.2800899887514060742407199100112e-4;
|
|
char floatString[15] = {0};
|
|
float Vcc;
|
|
|
|
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;
|
|
} |