mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-11 17:54:34 +00:00
Battery measurement Added
This commit is contained in:
1 parent
65e218e47b
commit
e1a7b69fee
1 file changed
+4
+4
@@ -11,6 +11,7 @@ const char* SERVER_ADRESS = "";
|
||||
|
||||
StaticJsonDocument<250> jsonBuffer;
|
||||
String requestJson = "";
|
||||
ADC_MODE(ADC_VCC);
|
||||
|
||||
//Pins
|
||||
#define SENZORPIN 12 //12
|
||||
@@ -27,6 +28,9 @@ void setup() {
|
||||
jsonBuffer["token"] = HW_TOKEN;
|
||||
jsonBuffer["values"]["door"]["value"] = 0;
|
||||
|
||||
int batteryVoltage = (ESP.getVcc() + 600) / 1000;
|
||||
jsonBuffer["values"]["battery"]["value"] = batteryVoltage;
|
||||
|
||||
serializeJson(jsonBuffer, requestJson);
|
||||
sendHttpRequest(requestJson);
|
||||
|
||||
|
||||
Reference in new issue
Block a user