onboard_neopixel
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| onboard_neopixel [2026/07/19 13:27] – [NeoPixel Blink Code] walkeradmin | onboard_neopixel [2026/07/21 08:51] (current) – walkeradmin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== OnBoard NeoPixel ====== | ====== OnBoard NeoPixel ====== | ||
| - | <color #db5f0b>Jun 2026</ | + | <color #db5f0b>Jul 2026</ |
| \\ | \\ | ||
| \\ | \\ | ||
| Line 6: | Line 6: | ||
| ---- | ---- | ||
| ===== Introduction ===== | ===== Introduction ===== | ||
| + | \\ | ||
| + | * Not for Raspberry Pi Pico. | ||
| \\ | \\ | ||
| The RP2040-Zero mini has an onboard NeoPixel. So we cannot use the Raspberry Pi Pico code to use this LED. Instead we need to use some Micro Python specific to the Waveshare (or compatible) device. | The RP2040-Zero mini has an onboard NeoPixel. So we cannot use the Raspberry Pi Pico code to use this LED. Instead we need to use some Micro Python specific to the Waveshare (or compatible) device. | ||
| Line 76: | Line 78: | ||
| #(0, 0, 0) # Off | #(0, 0, 0) # Off | ||
| + | So 255, 0, 0 will give a bright Red. 8, 0, 0 will give a dull Red. You don't have to use values of 255 all the time, you can use lower values to lower the LED brightness. | ||
| \\ | \\ | ||
| \\ | \\ | ||
| Line 82: | Line 85: | ||
| ==== NeoPixel Blink Code with Comments ==== | ==== NeoPixel Blink Code with Comments ==== | ||
| + | Below we can see the same code, but with lots and lots of comments to really help you understand how this Micro Python code works with the onboard Neo Pixel. | ||
| + | \\ | ||
| < | < | ||
| # Import the Pin class from the machine module. | # Import the Pin class from the machine module. | ||
| Line 105: | Line 109: | ||
| # | # | ||
| # Pin(LED_PIN) tells MicroPython which GPIO pin is connected | # Pin(LED_PIN) tells MicroPython which GPIO pin is connected | ||
| - | # to the LED. | + | # to the LED. The GPIO pin number is set by previous variable LED_PIN=16 |
| # | # | ||
| # The second parameter (1) tells it there is only ONE RGB LED | # The second parameter (1) tells it there is only ONE RGB LED | ||
| Line 130: | Line 134: | ||
| # Green = 0 | # Green = 0 | ||
| # Blue = 0 | # Blue = 0 | ||
| - | np[0] = (8, 0, 8) | + | np[0] = (8, 0, 8) # I changed the colour from bright Red to a soft Purple. |
| # Send the colour data to the LED. | # Send the colour data to the LED. | ||
onboard_neopixel.1784467621.txt.gz · Last modified: by walkeradmin
