File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 42
42
start_pwm = 0
43
43
end_pwm = 32767 # 50% (32767, or half of the maximum 65535):
44
44
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
49
51
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
53
56
54
57
# Note if auto_write was disabled you need to call write on the parent to
55
58
# make sure the value is written (this is not common, if disabling auto_write
You can’t perform that action at this time.
0 commit comments