onboard_neopixel
This is an old revision of the document!
Table of Contents
OnBoard NeoPixel
Introduction
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 NeoPixel is situated between the Boot and Reset buttons.
As this is a NeoPixel, we need to provide the RGB value for it to work, this is the main difference between the RPi Pico. We create RGB value, write it to memory and then turn on the LED.
NeoPixel Blink Code
What the code below does is simple turn on and off the NeoPixel, first we can see the Micro Python code, there are no comments so as not to create too much clutter, but the code with comments is below.
- | download
from machine import Pin import neopixel import time LED_PIN = 16 np = neopixel.NeoPixel(Pin(LED_PIN), 1) while True: np[0] = (8, 0, 8) np.write() time.sleep(0.5) np[0] = (0, 0, 0) np.write() time.sleep(0.5)
onboard_neopixel.1784466338.txt.gz · Last modified: by walkeradmin

