RGB LED(4灯)

../../../../_images/%E5%9B%9B%E8%89%B2LED-H.png

概述

单板级联4颗RGB灯珠,采用LED专用主控芯片WS2812,支持单总线控制。

技术参数

工作电压: VCC 3.3V -5V

模块尺寸:24*48mm

固定安装:2个兼容塑料积木通孔

控制方式:RGB分量

引脚定义

引脚

定义

GND

地

VCC

电源

DI

控制信号输入

NC

空

示例程序

控制4个RGB灯依次按红绿蓝颜色点亮。

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%284%E7%81%AF%29.png