aboutsummaryrefslogtreecommitdiff
path: root/unicorn_hat_sim.py
diff options
context:
space:
mode:
Diffstat (limited to 'unicorn_hat_sim.py')
-rw-r--r--unicorn_hat_sim.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/unicorn_hat_sim.py b/unicorn_hat_sim.py
index 9d7d1a0..c2cd8b1 100644
--- a/unicorn_hat_sim.py
+++ b/unicorn_hat_sim.py
@@ -27,7 +27,8 @@ class UnicornHatSim(object):
pygame.init()
pygame.display.set_caption("Unicorn HAT simulator")
self.screen = pygame.display.set_mode([self.window_width, self.window_height])
- self.clear()
+ # self.clear()
+ self.screen.fill((0, 0, 0))
def set_pixel(self, x, y, r, g, b):
i = (x * self.width) + y
@@ -55,7 +56,8 @@ class UnicornHatSim(object):
self.draw_led(x, y)
def show(self):
- self.clear()
+ # self.clear()
+ self.screen.fill((0, 0, 0))
self.draw()
pygame.display.flip()
@@ -81,8 +83,9 @@ class UnicornHatSim(object):
self._rotation = int(round(r/90.0)) % 3
def clear(self):
- self.screen.fill((0, 0, 0))
-
+ # self.screen.fill((0, 0, 0))
+ self.pixels = [(0, 0, 0)] * self.width * self.height
+
def get_rotation(self):
return self._rotation * 90