WS2812 RGB led ring example on Microbit with Edublocks

This was a WS2812b led ring that I purchased for low cost. There are 12 LEDs in total on this and once you solder 3 cables to the module you are ready to go

Connect Vcc to MIcro:Bit 3.3 volts, Gnd to Gnd and the In to MIcro:Bit 0,

Open Edublocks and create the following

 

Here is the python code that is created

[codesyntax lang=”python”]

np = None


from microbit import *
import neopixel
np = neopixel.NeoPixel(pin0,12)
while True:
  for red in range(12):
    np[red] = (255,0,0)
    np.show()
  sleep(500)
  for green in range(12):
    np[green] = (0,255,0)
    np.show()
  sleep(500)
  for blue in range(12):
    np[blue] = (0,0,255)
    np.show()
  sleep(500)

[/codesyntax]

 

Download

Downloads

Leave a Comment

This div height required for enabling the sticky sidebar
Ad Clicks : Ad Views : Ad Clicks : Ad Views :