Skip to content

Commit 585796f

Browse files
committed
Add workshop exercise skeleton solution
1 parent 682d01c commit 585796f

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

Diff for: pslab/blink.py

-14
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,6 @@ def blink(psl: pslab.ScienceLab, color: tuple[int, int, int], period: int) -> No
1717
period : int
1818
Blink period in milliseconds.
1919
"""
20-
toggle = time.time()
21-
state = 0
22-
23-
while True:
24-
if period / 2 < (time.time() - toggle) * 1000:
25-
if state:
26-
# Turn off LED.
27-
psl.rgb_led((0, 0, 0))
28-
else:
29-
# Turn on LED.
30-
psl.rgb_led(color)
31-
32-
state = not state
33-
toggle = time.time()
3420

3521

3622
def blink_c(psl: pslab.ScienceLab, color: tuple[int, int, int], period: int) -> None:

0 commit comments

Comments
 (0)