mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-14 10:35:53 +00:00
Usually, images are static, so they can be computed in advance instead of during runtime. This makes scripts smaller and much more memory efficient. For example, now you can say: HOUSE = 4685823 hub.grid.image(HOUSE) since 4685823 = ``` 0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ``` We could also choose the binary format to allow for more generic screen sizes. If we allow a bit more space (2 words instead of 1), we could do 1 byte per row to allow screens up to 8x8. Right now, though, we choose 1 word < 31 bits which is a bit more efficient in MicroPython. We can easily list numerous example in the docs or provide a simple visual calculator. There is still a matrix method that takes a 2D matrix of intensities for full control during runtime, which is what the image() method was doing initially. This commit renames the old draft to matrix().