fix bug where voltage is always sent
This commit is contained in:
parent
82df106df1
commit
7c9678a57c
@ -22,15 +22,16 @@ void setup() {
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (counter % SEND_VCC_INTERVAL == 0) {
|
||||
sensor.sendStateAndVoltage(true);
|
||||
counter = 0;
|
||||
if (counter == 0) {
|
||||
sensor.sendStateAndVoltage(false);
|
||||
} else if (counter % SEND_INTERVAL == 0) {
|
||||
sensor.sendState(true);
|
||||
sensor.sendState(false);
|
||||
}
|
||||
TinyPower::sleep();
|
||||
}
|
||||
|
||||
ISR(WDT_vect) {
|
||||
counter++;
|
||||
if (++counter % SEND_VCC_INTERVAL == 0) {
|
||||
counter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user