All tutorials

3 · Outputs & actuators

WS2812 strip: rainbow

Advanced25 min

Goal

Animate a gradient scrolling along the addressable strip.

Why it matters

Each LED has its own controller: a single data wire drives hundreds of pixels.

Steps

  1. 01Add the NeoPixel strip on pin 6.
  2. 02Write a wheel(pos) function returning a colour.
  3. 03Shift the offset on every loop pass.
  4. 04Watch the current: 60 mA per LED at full power.

This tutorial runs inside the Circuitly simulator: your wiring and your code are checked automatically at every step.

Next tutorials