Skip to content

Commit 1a6049f

Browse files
authored
Merge pull request #2732 from jacobrose/patch-1
Readability improvements
2 parents 3c2bbe0 + 00e455f commit 1a6049f

File tree

1 file changed

+8
-3
lines changed
  • MEMENTO/Memento_IOT_Doorbell

1 file changed

+8
-3
lines changed

MEMENTO/Memento_IOT_Doorbell/code.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,24 @@ def capture_send_image():
8383
print("Sent image to IO!")
8484
else:
8585
print("ERROR: JPEG frame capture failed!")
86-
print("DONE, waiting for next press..")
87-
# Turn the LED on to signal that the doorbell is ready to be pressed again
88-
led.value = True
8986

9087

9188
while True:
9289
# Wait until the doorbell is pressed
9390
if not pin_button.value:
9491
print("Doorbell pressed!")
92+
9593
# Turn the doorbell LED off to signal that it has been pressed
9694
led.value = False
95+
9796
# Play a doorbell tone using the speaker
9897
pycam.tone(95, 0.5)
9998
pycam.tone(70, 0.5)
99+
100100
capture_send_image()
101+
102+
print("DONE, waiting for next press..")
103+
104+
# Turn the LED on to signal that the doorbell is ready to be pressed again
105+
led.value = True
101106
time.sleep(0.01)

0 commit comments

Comments
 (0)