Battery measurement Added
This commit is contained in:
parent
65e218e47b
commit
e1a7b69fee
@ -11,6 +11,7 @@ const char* SERVER_ADRESS = "";
|
|||||||
|
|
||||||
StaticJsonDocument<250> jsonBuffer;
|
StaticJsonDocument<250> jsonBuffer;
|
||||||
String requestJson = "";
|
String requestJson = "";
|
||||||
|
ADC_MODE(ADC_VCC);
|
||||||
|
|
||||||
//Pins
|
//Pins
|
||||||
#define SENZORPIN 12 //12
|
#define SENZORPIN 12 //12
|
||||||
@ -27,6 +28,9 @@ void setup() {
|
|||||||
jsonBuffer["token"] = HW_TOKEN;
|
jsonBuffer["token"] = HW_TOKEN;
|
||||||
jsonBuffer["values"]["door"]["value"] = 0;
|
jsonBuffer["values"]["door"]["value"] = 0;
|
||||||
|
|
||||||
|
int batteryVoltage = (ESP.getVcc() + 600) / 1000;
|
||||||
|
jsonBuffer["values"]["battery"]["value"] = batteryVoltage;
|
||||||
|
|
||||||
serializeJson(jsonBuffer, requestJson);
|
serializeJson(jsonBuffer, requestJson);
|
||||||
sendHttpRequest(requestJson);
|
sendHttpRequest(requestJson);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user