Skip to content

Commit 43cd470

Browse files
authored
Merge pull request #2216 from domdfcoding/patch-1
RGB_LED_Strips: Change sleep from 10 seconds to 10 milliseconds
2 parents 5fb2d3c + 824ef9a commit 43cd470

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

RGB_LED_Strips/code.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,29 +30,29 @@ def duty_cycle(percent):
3030
# Fade from nothing up to full red.
3131
for i in range(100):
3232
red.duty_cycle = duty_cycle(i)
33-
time.sleep(FADE_SLEEP)
33+
time.sleep(FADE_SLEEP / 1000)
3434

3535
# Now fade from violet (red + blue) down to red.
3636
for i in range(100, -1, -1):
3737
blue.duty_cycle = duty_cycle(i)
38-
time.sleep(FADE_SLEEP)
38+
time.sleep(FADE_SLEEP / 1000)
3939

4040
# Fade from red to yellow (red + green).
4141
for i in range(100):
4242
green.duty_cycle = duty_cycle(i)
43-
time.sleep(FADE_SLEEP)
43+
time.sleep(FADE_SLEEP / 1000)
4444

4545
# Fade from yellow to green.
4646
for i in range(100, -1, -1):
4747
red.duty_cycle = duty_cycle(i)
48-
time.sleep(FADE_SLEEP)
48+
time.sleep(FADE_SLEEP / 1000)
4949

5050
# Fade from green to teal (blue + green).
5151
for i in range(100):
5252
blue.duty_cycle = duty_cycle(i)
53-
time.sleep(FADE_SLEEP)
53+
time.sleep(FADE_SLEEP / 1000)
5454

5555
# Fade from teal to blue.
5656
for i in range(100, -1, -1):
5757
green.duty_cycle = duty_cycle(i)
58-
time.sleep(FADE_SLEEP)
58+
time.sleep(FADE_SLEEP / 1000)

0 commit comments

Comments
 (0)