Fixes Flake 8 issues Adafruit LED Sequins
This commit is contained in:
parent
79790d5d3d
commit
b2256e9a3b
1 changed files with 7 additions and 7 deletions
|
|
@ -1,10 +1,10 @@
|
|||
import time
|
||||
import board
|
||||
import pulseio
|
||||
import time
|
||||
from digitalio import DigitalInOut, Direction
|
||||
|
||||
# PWM (fading) LEDs are connected on D0 (PWM not avail on D1)
|
||||
pwm_leds = board.D0
|
||||
pwm_leds = board.D0
|
||||
pwm = pulseio.PWMOut(pwm_leds, frequency=1000, duty_cycle=0)
|
||||
|
||||
# digital LEDs connected on D2
|
||||
|
|
@ -18,7 +18,7 @@ counter = 0 # counter to keep track of cycles
|
|||
while True:
|
||||
|
||||
# And send to LED as PWM level
|
||||
pwm.duty_cycle = brightness
|
||||
pwm.duty_cycle = brightness
|
||||
|
||||
# change the brightness for next time through the loop:
|
||||
brightness = brightness + fade_amount
|
||||
|
|
@ -26,10 +26,10 @@ while True:
|
|||
print(brightness)
|
||||
|
||||
# reverse the direction of the fading at the ends of the fade:
|
||||
if ( brightness <= 0 ):
|
||||
if brightness <= 0:
|
||||
fade_amount = -fade_amount
|
||||
counter += 1
|
||||
elif ( brightness >= 65535 ):
|
||||
elif brightness >= 65535:
|
||||
fade_amount = -fade_amount
|
||||
counter += 1
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ while True:
|
|||
# checking the modulo of the counter.
|
||||
# the modulo function gives you the remainder of
|
||||
# the division of two numbers:
|
||||
if ( counter % 4 == 0 ):
|
||||
digital_leds.value = True
|
||||
if counter % 4 == 0:
|
||||
digital_leds.value = True
|
||||
else:
|
||||
digital_leds.value = False
|
||||
|
|
|
|||
Loading…
Reference in a new issue