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

CheerLights example for the Galactic Unicorn #546

Merged
merged 9 commits into from Mar 1, 2023

Conversation

Corteil
Copy link
Contributor

@Corteil Corteil commented Oct 25, 2022

Simple IoT (internet of things) example code.

CheerLights MicroPython client.

You will need the secrets file with your network details, in the same folder as cheerlights.py to run on start rename cheerlights.py to main.py

CheerLights MicroPython client. You will need the secrets file with your network details, in the same folder as cheerlights.py to run on start rename cheerlights.py to main.py
change name and password to match your network in secrets.py
Add new line to line 2
corrected formatting,
@ZodiusInfuser ZodiusInfuser added [- galactic unicorn -] https://shop.pimoroni.com/products/galactic-unicorn micropython This issue or request relates to micropython (either code or bindings) labels Jan 20, 2023
@Gadgetoid
Copy link
Member

Thank you!

Couple of changes -

Our readme generally says to use WIFI_CONFIG.py from the common/ dir, which covers WiFi config for all examples. No need to add secrets.py into the mix.

cheer-lights.py should be named cheerlights.py. Dashes in filenames break import and some people like to import example_name from the REPL to run files.

@Gadgetoid Gadgetoid added the waiting for changes Changes to a request have been asked for label Feb 10, 2023
Updated to use the Pimoroni standard Wi-Fi method to be inline with other examples and rename filed to cheerlights.py so can be import from REPL
@Corteil
Copy link
Contributor Author

Corteil commented Feb 14, 2023

I have made the suggested changes to my code and have renamed cheer-lights.py to cheerlights.py as requested.

@helgibbons
Copy link
Contributor

Thanks Brian, testing it now :)

@helgibbons helgibbons self-assigned this Feb 22, 2023
@Gadgetoid
Copy link
Member

Thanks Brian!

Note that:

graphics.set_pen(color)
graphics.clear()

Has the same effect as:

    for x in range(width):
        for y in range(height):
            graphics.set_pen(colour)
            graphics.pixel(x, y)

And would be much, much faster.

I do wonder if we could also do a numpy magic spin on this, to set the colours from the right-hand edge and propagate them across.

@helgibbons
Copy link
Contributor

Been running for a few hours and seems to be working good :)

updated with @Gadgetoid suggestion.
removed white space from line 20 in cheerlights
@helgibbons helgibbons removed the waiting for changes Changes to a request have been asked for label Mar 1, 2023
@helgibbons
Copy link
Contributor

Looks good, many thanks!

@helgibbons helgibbons merged commit 1dbd3ea into pimoroni:main Mar 1, 2023
19 checks passed
@Corteil Corteil deleted the Galactic-Unicorn-CheerLights branch March 1, 2023 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[- galactic unicorn -] https://shop.pimoroni.com/products/galactic-unicorn micropython This issue or request relates to micropython (either code or bindings)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants