Wetterstation/include/mess_Ub.h

22 lines
469 B
C
Raw Normal View History

2024-04-06 22:56:10 +02:00
#include <Arduino.h>
const float MinimalSpannung = 2.85;
2024-07-03 10:31:08 +02:00
float korectur = 0.001015;
2024-04-06 22:56:10 +02:00
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 = analogRead(A0);
2024-07-03 10:31:08 +02:00
Vcc = Vcc * ((100+220+220)/100);
2024-04-06 22:56:10 +02:00
float VCC = Vcc * korectur ;
Serial.printf("Rohdaten: %d, ", Vcc);
dtostrf(VCC,8,2,floatString);
Serial.printf("Vcc: \t%s V\n", floatString);
return VCC;
}