Skip to content

Commit f659b00

Browse files
authored
Merge pull request #5 from adafruit/loop_simpletest
loop simpletest
2 parents fc4d1bf + d0054d0 commit f659b00

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

examples/tlc5947_simpletest.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,17 @@
4242
start_pwm = 0
4343
end_pwm = 32767 # 50% (32767, or half of the maximum 65535):
4444

45-
for pin in (red, green, blue):
46-
# Brighten:
47-
for pwm in range(start_pwm, end_pwm, step):
48-
pin.duty_cycle = pwm
45+
while True:
46+
for pin in (red, green, blue):
47+
# Brighten:
48+
print("Brightening LED")
49+
for pwm in range(start_pwm, end_pwm, step):
50+
pin.duty_cycle = pwm
4951

50-
# Dim:
51-
for pwm in range(end_pwm, start_pwm, 0 - step):
52-
pin.duty_cycle = pwm
52+
# Dim:
53+
print("Dimming LED")
54+
for pwm in range(end_pwm, start_pwm, 0 - step):
55+
pin.duty_cycle = pwm
5356

5457
# Note if auto_write was disabled you need to call write on the parent to
5558
# make sure the value is written (this is not common, if disabling auto_write

0 commit comments

Comments
 (0)