i must have been tired last night
This commit is contained in:
parent
13ea04c3e1
commit
97e989bd40
1 changed files with 8 additions and 9 deletions
17
__init__.py
17
__init__.py
|
@ -84,6 +84,7 @@ class Quox(Application):
|
|||
self.clear(ctx)
|
||||
# self.text(ctx)
|
||||
self.quox_sprite(ctx)
|
||||
self.update_leds()
|
||||
|
||||
def clear(self, ctx):
|
||||
ctx.rgb(0, .1, .15) \
|
||||
|
@ -118,7 +119,6 @@ class Quox(Application):
|
|||
self.pick_direction()
|
||||
self.pick_step()
|
||||
self.maybe_move()
|
||||
self.update_leds()
|
||||
|
||||
def add_boxes(self, state):
|
||||
for i, button in enumerate(state.captouch.petals):
|
||||
|
@ -212,14 +212,13 @@ class Quox(Application):
|
|||
return self.towards(self.direction, self.target())
|
||||
|
||||
def update_leds(self):
|
||||
leds.set_all_rgb(0, 0, 0)
|
||||
for i in range(10):
|
||||
if i in self.boxes:
|
||||
center = i * 4
|
||||
left = (center - 1) % 40
|
||||
right = (center + 1) % 40
|
||||
for led in [left, right, center]:
|
||||
leds.set_hsv(led, ((i + 4) * 36) % 360, 1, 1)
|
||||
leds.set_all_hsv(0, 0, 1)
|
||||
for i in self.boxes:
|
||||
center = i * 4
|
||||
left = (center - 1) % 40
|
||||
right = (center + 1) % 40
|
||||
for led in [left, right, center]:
|
||||
leds.set_hsv(led, ((i + 4) * 36) % 360, 1, 1)
|
||||
leds.update()
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Reference in a new issue