RGB LED

../../../../_images/RGB_LED.png

概述

可实现256级亮度显示,16777216种颜色的全真色彩显示颜色。

技术参数

工作电压: VCC 3.3V -5V

模块尺寸:24*48mm

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

控制方式:RGB分量

引脚定义

引脚

定义

GND

地

VCC

电源

DI

控制信号输入

NC

空

示例程序

依次按照红绿蓝点亮LED灯。

from mpython import *

import neopixel

my_rgb = neopixel.NeoPixel(Pin(Pin.P15), n=1, 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()
../../../../_images/RGB_LED1.png