RGB LED (4 LEDs)

../../../../_images/four_color_led_h.png

Overview

Single-board cascade of 4 RGB LEDs using the WS2812 dedicated LED driver chip, supporting single-wire bus control.

Technical Specifications

Operating voltage: VCC 3.3V -5V

Module dimensions: 24*48mm

Mounting: 2 plastic building block compatible through-holes

Control mode: RGB components

Pin Definition

Pin

Definition

GND

Ground

VCC

Power

DI

Control signal input

NC

Not connected

Example Code

Controls 4 RGB LEDs to light up in sequence: red, green, blue.

from mpython import *

import neopixel

my_rgb = neopixel.NeoPixel(Pin(Pin.P15), n=4, bpp=3, timing=1)

import time
while True:
    my_rgb.fill( (255, 0, 0) )
    my_rgb.write()
    time.sleep(0.5)
    my_rgb.fill( (0, 255, 0) )
    my_rgb.write()
    time.sleep(0.5)
    my_rgb.fill( (0, 0, 255) )
    my_rgb.write()
    time.sleep(0.5)
../../../../_images/rgb_led_4.png