Python RGB Matrix games and animations https://www.xythobuz.de/ledmatrix_v2.html
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

solid.py 773B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env python3
  2. import time
  3. class Solid:
  4. def __init__(self, g, t = 1.0, c = (0, 0, 0)):
  5. self.gui = g
  6. self.time = t
  7. self.color = c
  8. self.restart()
  9. def restart(self):
  10. self.start = time.time()
  11. def finished(self):
  12. return (time.time() - self.start) >= self.time
  13. def draw(self):
  14. for x in range(0, self.gui.width):
  15. for y in range(0, self.gui.height):
  16. self.gui.set_pixel(x, y, self.color)
  17. if __name__ == "__main__":
  18. import platform
  19. t = None
  20. if platform.machine() == "armv7l":
  21. from pi import PiMatrix
  22. t = PiMatrix()
  23. else:
  24. from test import TestGUI
  25. t = TestGUI()
  26. d = Solid(t, 1.0, (0, 255, 0))
  27. t.debug_loop(d.draw)