fixing pylint
3rd attempt
This commit is contained in:
parent
c38a83ae3a
commit
c0d75b8432
1 changed files with 11 additions and 9 deletions
|
|
@ -15,12 +15,12 @@ import simpleio
|
|||
from adafruit_ticks import ticks_ms, ticks_add, ticks_diff
|
||||
from rainbowio import colorwheel
|
||||
|
||||
COLOR = (255, 150, 0) # yellow
|
||||
COLOR = (255, 150, 0) # yellow
|
||||
OFF = (0, 0, 0)
|
||||
PIXEL_PIN = board.A0
|
||||
NUM_PIXELS = 6
|
||||
timers = [6, 10, 15, 20, 25, 30] # minutes
|
||||
color_time = 20 # milliseconds
|
||||
timers = [6, 10, 15, 20, 25, 30] # minutes
|
||||
color_time = 20 # milliseconds
|
||||
|
||||
# rotary encoder
|
||||
i2c = board.STEMMA_I2C()
|
||||
|
|
@ -36,7 +36,7 @@ pixels = neopixel.NeoPixel(PIXEL_PIN, NUM_PIXELS, brightness=0.2, auto_write=Fal
|
|||
pixels.fill(OFF)
|
||||
pixels.show()
|
||||
|
||||
#display setup
|
||||
# display setup
|
||||
displayio.release_displays()
|
||||
|
||||
# oled
|
||||
|
|
@ -46,17 +46,17 @@ WIDTH = 128
|
|||
HEIGHT = 64
|
||||
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=WIDTH, height=HEIGHT)
|
||||
|
||||
font = bitmap_font.load_font('/Arial-14.bdf')
|
||||
font = bitmap_font.load_font("/Arial-14.bdf")
|
||||
main_area = label.Label(font, text="6 Minutes", color=0xFFFFFF)
|
||||
main_area.anchor_point = (0.5, 0.0)
|
||||
main_area.anchored_position = (display.width / 2, display.height/2)
|
||||
main_area.anchored_position = (display.width / 2, display.height / 2)
|
||||
splash = displayio.Group()
|
||||
splash.append(main_area)
|
||||
display.root_group = splash
|
||||
|
||||
timer_index = 0
|
||||
timer = timers[timer_index]
|
||||
time_remaining = timer*60000
|
||||
time_remaining = timer * 60000
|
||||
active_timer = False
|
||||
timer_clock = ticks_ms()
|
||||
color_clock = ticks_ms()
|
||||
|
|
@ -94,8 +94,10 @@ while True:
|
|||
remaining //= 60
|
||||
mins_remaining = remaining % 60
|
||||
if time_remaining > 0:
|
||||
mapped_time = simpleio.map_range(time_remaining, 0, (timer*60000), 0, NUM_PIXELS+1)
|
||||
if mapped_time < 1 :
|
||||
mapped_time = simpleio.map_range(
|
||||
time_remaining, 0, (timer * 60000), 0, NUM_PIXELS + 1
|
||||
)
|
||||
if mapped_time < 1:
|
||||
mapped_time = 1
|
||||
if int(mapped_time) != last_map:
|
||||
pixels.fill(OFF)
|
||||
|
|
|
|||
Loading…
Reference in a new issue