Skip to content

esp32 M5STACK_ATOM: Add set_pixel_color_x_y and get_pixel_color_x_y.#13350

Open
simonprickett wants to merge 1 commit intomicropython:masterfrom
simonprickett:master
Open

esp32 M5STACK_ATOM: Add set_pixel_color_x_y and get_pixel_color_x_y.#13350
simonprickett wants to merge 1 commit intomicropython:masterfrom
simonprickett:master

Conversation

@simonprickett
Copy link

@simonprickett simonprickett commented Jan 4, 2024

This pull request adds utility functions to set and get pixel colors on an M5Stack Atom Matrix device by x, y position.

Valid values of x and y are 0-4 inclusive.

Tested on an M5Stack Atom Matrix as follows:

>>> import atom
>>> a = atom.Matrix()
>>> a.set_pixel_color_x_y(0, 0, 16, 0, 0)
>>> a.set_pixel_color_x_y(4, 4, 0, 16, 0)
>>> a.get_pixel_color_x_y(0, 0)
(16, 0, 0)
>>> a.set_pixel_color_x_y(5, 0, 16, 0, 0)
>>> a.set_pixel_color_x_y(0, 5, 16, 0, 0)
>>> a.get_pixel_color_x_y(6, 6)
>>> a.get_pixel_color_x_y(-1, -1)

Follows convention established in atom.py that invalid values for x and y do nothing.

Image showing the code above running on a device...

IMG_8333

@dpgeorge dpgeorge changed the title Add set_pixel_color_x_y and get_pixel_color_x_y. esp32 M5STACK_ATOM: Add set_pixel_color_x_y and get_pixel_color_x_y. Jan 5, 2024
@simonprickett
Copy link
Author

Guessing this one isn't going places, should I close it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants