Skip to content

Commit 0b4ca16

Browse files
author
Mikey Sklar
committed
linted clean, changed exit/enter varnames
1 parent 039b53b commit 0b4ca16

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

Sitcom_SFX_Door_Trigger/Sitcom_SFX_Door_Trigger.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
door_led = DigitalInOut(door_led_pin)
2121
door_led.direction = Direction.OUTPUT
22-
door_led.value = False
22+
door_led.value = False
2323

2424
motion_led = DigitalInOut(motion_led_pin)
2525
motion_led.direction = Direction.OUTPUT
@@ -31,8 +31,8 @@
3131
pygame.mixer.init(44100, -16, 2, 1024)
3232

3333
# sound files expect to be in the same directory as script
34-
enter = pygame.mixer.Sound("./enter.wav")
35-
exit = pygame.mixer.Sound("./exit.wav")
34+
enter_sound = pygame.mixer.Sound("./enter.wav")
35+
exit_sound = pygame.mixer.Sound("./exit.wav")
3636

3737
while True:
3838

@@ -47,16 +47,15 @@
4747
motion_led.value = True
4848
else:
4949
motion_led.value = False
50-
51-
# When the door is opened, if there is movement outside,
52-
# It means that someone is entering.
50+
51+
# When the door is opened, if there is movement outside,
52+
# It means that someone is entering.
5353
# If not, someone is exiting.
54-
if door.value and not prev_door:
54+
if door.value and not prev_door:
5555
if motion.value:
56-
enter.play()
56+
enter_sound.play()
5757
else:
58-
exit.play()
59-
58+
exit_sound.play()
59+
6060
prev_door = door.value
61-
6261
time.sleep(0.01)

0 commit comments

Comments
 (0)