Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp32 M5STACK_ATOM: Add set_pixel_color_x_y and get_pixel_color_x_y. #13350

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
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.

None yet

2 participants