From fc9171da083a4382b7bc4e2db718604d6d8f300f Mon Sep 17 00:00:00 2001 From: Felix Pankratz Date: Tue, 17 Dec 2024 10:29:03 +0100 Subject: [PATCH] draw some more frames --- simulator/sine_grid.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/simulator/sine_grid.py b/simulator/sine_grid.py index 89ffdd7..2934ab2 100644 --- a/simulator/sine_grid.py +++ b/simulator/sine_grid.py @@ -3,6 +3,7 @@ import math from color import Color from matrix import Matrix +import time import random class Cell: @@ -19,13 +20,15 @@ class Cell: def main(): m = Matrix() cells = [Cell() for _ in range(2048)] - for index, cell in enumerate(cells): - m.drawPixel(index % 64, index // 64, Color( - round(cell.get_value()*255), - 0, - 0 - )) - m.show() - + for i in range(255): + for index, cell in enumerate(cells): + cell.state += 0.2 + m.drawPixel(index % 64, index // 64, Color( + round(cell.get_value()*255), + 0, + 0 + )) + m.show() + time.sleep(0.3) if __name__ == '__main__': main()