Skip to content

Commit

Permalink
Replaced "magic" address with TOUCHWHEEL_ADDRESS
Browse files Browse the repository at this point in the history
  • Loading branch information
baileysage committed Nov 6, 2024
1 parent 2814d13 commit 3afccbd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions software/software/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ def petal_init(bus):

def touchwheel_read(bus):
"""Returns 0 for no touch, 1-255 clockwise around the circle from the south"""
return(touchwheel_bus.readfrom_mem(84, 0, 1)[0])
return(touchwheel_bus.readfrom_mem(TOUCHWHEEL_ADDRESS, 0, 1)[0])

def touchwheel_rgb(bus, r, g, b):
"""RGB color on the central display. Each 0-255"""
touchwheel_bus.writeto_mem(84, 15, bytes([r]))
touchwheel_bus.writeto_mem(84, 16, bytes([g]))
touchwheel_bus.writeto_mem(84, 17, bytes([b]))
touchwheel_bus.writeto_mem(TOUCHWHEEL_ADDRESS, 15, bytes([r]))
touchwheel_bus.writeto_mem(TOUCHWHEEL_ADDRESS, 16, bytes([g]))
touchwheel_bus.writeto_mem(TOUCHWHEEL_ADDRESS, 17, bytes([b]))


## goes green if wheel configured
Expand Down

0 comments on commit 3afccbd

Please sign in to comment.