Skip to content

Commit 0d00e22

Browse files
committed
Fix error and add chirp when correct code entered.
1 parent c910bfd commit 0d00e22

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libraries/MySensors/examples/SecretKnockSensor/SecretKnockSensor.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
chirp(500, 1500);
102102
delay(500);
103103
}
104-
while (digitalRead(programButton) == HIGH){
104+
while (digitalRead(programButton) == LOW){
105105
delay(10); // Hang around until the button is released.
106106
}
107107
}
@@ -172,6 +172,8 @@
172172
if (programModeActive == false){ // Only do this if we're not recording a new knock.
173173
if (validateKnock() == true){
174174
// Lock/unlock door
175+
chirp(500, 1500); // And play a tone in case the user can't see the LED.
176+
chirp(500, 1000);
175177
setLockState(!lockStatus, true);
176178
} else {
177179
Serial.println("fail unlock");

0 commit comments

Comments
 (0)