前言
今天了解和学习如何使用 bpibit 上的 按键与 LED 面板
下面示例会用到 NeoPixelBus 库,所以需要到 Arduino 库管理中下载
操作环境
测试使用的开发板: bpi-bit v1.2
应用到的外设: WS2812b
测试使用的软件:Arduino IDE 1.8.9
函数解析
RgbColor(uint8_t r, uint8_t g, uint8_t b) : R(r), G(g), B(b) { };
使用r、g、b值(0-255)构造 rgbcolor
void SetPixelColor(uint16_t indexPixel, typename T_COLOR_FEATURE::ColorObject color)
在指定的位置的灯点亮相应颜色
参数 | 功能 |
---|---|
indexPixel | LED 面板的标号(关于标号可以拉到下面看参考资料) |
color | 自定义的颜色 |