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.clear(ctx)
|
||||||
# self.text(ctx)
|
# self.text(ctx)
|
||||||
self.quox_sprite(ctx)
|
self.quox_sprite(ctx)
|
||||||
|
self.update_leds()
|
||||||
|
|
||||||
def clear(self, ctx):
|
def clear(self, ctx):
|
||||||
ctx.rgb(0, .1, .15) \
|
ctx.rgb(0, .1, .15) \
|
||||||
|
@ -118,7 +119,6 @@ class Quox(Application):
|
||||||
self.pick_direction()
|
self.pick_direction()
|
||||||
self.pick_step()
|
self.pick_step()
|
||||||
self.maybe_move()
|
self.maybe_move()
|
||||||
self.update_leds()
|
|
||||||
|
|
||||||
def add_boxes(self, state):
|
def add_boxes(self, state):
|
||||||
for i, button in enumerate(state.captouch.petals):
|
for i, button in enumerate(state.captouch.petals):
|
||||||
|
@ -212,14 +212,13 @@ class Quox(Application):
|
||||||
return self.towards(self.direction, self.target())
|
return self.towards(self.direction, self.target())
|
||||||
|
|
||||||
def update_leds(self):
|
def update_leds(self):
|
||||||
leds.set_all_rgb(0, 0, 0)
|
leds.set_all_hsv(0, 0, 1)
|
||||||
for i in range(10):
|
for i in self.boxes:
|
||||||
if i in self.boxes:
|
center = i * 4
|
||||||
center = i * 4
|
left = (center - 1) % 40
|
||||||
left = (center - 1) % 40
|
right = (center + 1) % 40
|
||||||
right = (center + 1) % 40
|
for led in [left, right, center]:
|
||||||
for led in [left, right, center]:
|
leds.set_hsv(led, ((i + 4) * 36) % 360, 1, 1)
|
||||||
leds.set_hsv(led, ((i + 4) * 36) % 360, 1, 1)
|
|
||||||
leds.update()
|
leds.update()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Add table
Reference in a new issue