Skip to content

Conversation

@sago35
Copy link
Member

@sago35 sago35 commented May 3, 2024

The WS2812 example had variations due to its dependency on led and the different PIN names used.
With this PR, boards with WS2812 now have machine.WS2812 available.
This PR makes the following changes:

  • Remove dependency on machine.LED (as some variations don't have machine.LED)
  • Update to use machine.WS2812 where it is defined

@sago35
Copy link
Member Author

sago35 commented May 3, 2024

My main motivation was to create an example of running WS2812 on waveshare-rp2040-zero. However, adding the new variation required many changes, so I created this PR. Going forward, this example will work without changes as long as machine.WS2812 is defined.

I have tested the following for verification and confirmed that at least the build is successful.

tinygo build -o /tmp/out.uf2 -target arduino               ./examples/ws2812/
tinygo build -o /tmp/out.uf2 -target digispark             ./examples/ws2812/
tinygo build -o /tmp/out.uf2 -target qtpy                  ./examples/ws2812/
tinygo build -o /tmp/out.bin -target m5stamp-c3            ./examples/ws2812/
tinygo build -o /tmp/out.uf2 -target thingplus-rp2040      ./examples/ws2812/
tinygo build -o /tmp/out.uf2 -target waveshare-rp2040-zero ./examples/ws2812/

Copy link
Member

@aykevl aykevl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good idea to me!

@deadprogram
Copy link
Member

Thank you for the improvements @sago35 and to @aykevl for review. Now merging.

@deadprogram deadprogram merged commit bb0e6b8 into dev May 6, 2024
@deadprogram deadprogram deleted the ws2812-wo-led branch May 6, 2024 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants