Main Menu

search

You are here

Blink on-board LED on RP2040

[last updated: 2024-09-17]
RP2040-Zero home page
-----------------------------

  • The RP2040-Zero on-board LED:
    is not a standard LED, ie. with a single control pin that you can just turn on and off
    by writing to a single GPIO


    In fact it is a "neoPixel", actually RGB

  • This is what worked to write to it:
      import machine, neopixel
      from time import sleep
      LEDpin = 16
      led = neopixel.NeoPixel(machine.Pin(LEDpin), 1)
      led[0] = (0, 0, 255) # blue
      led.write()
      sleep(1)
      led[0] = (0, 0, 0) # off
      led.write()