try to save battery by not sending VCC anymore

This commit is contained in:
Nicu Hodos 2019-11-14 22:58:19 +01:00
parent 34a6dbef65
commit 5f42a8fb27
3 changed files with 6 additions and 2 deletions

View File

@ -17,4 +17,8 @@ public:
void sendStateAndVoltage(bool state) {
sendInfo(ID(id) | VCC(readVcc()) | STATE(!state) | TYPE(7));
}
void sendState(bool state) {
sendInfo(ID(id) | VCC(0) | STATE(!state) | TYPE(7));
}
};

View File

@ -28,7 +28,7 @@ void loop() {
if (shouldSend) {
shouldSend = false;
currentState = digitalRead(SWITCH);
sensor.sendStateAndVoltage(currentState);
sensor.sendState(currentState);
}
TinyPower::sleep();
}

View File

@ -25,7 +25,7 @@ void loop() {
if (shouldSend) {
shouldSend = false;
currentState = digitalRead(SWITCH);
sensor.sendStateAndVoltage(currentState);
sensor.sendState(currentState);
}
TinyPower::sleep();
}