利用ESP32連接3LED的WS2812模組顯示RGB三原色和閃爍演示
#include <Adafruit_NeoPixel.h>
#define LED_PIN 15
#define LED_COUNT 3
// NeoPixel brightness, 0 (min) to 255 (max)
#define BRIGHTNESS 70 // Set BRIGHTNESS to about 1/5 (max = 255)
// Declare our NeoPixel strip object:
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRBW + NEO_KHZ800);
myObject["node"] = 8
myObject["function"] = WS2812
startHere: Received from 2085146597 msg={"node":8,"function":"WS2812","mode":"single","led0":"red","led1":"green","led2":"blue"}
圖一:接線圖
利用ESP32中控系統GUI傳送node8 的 mode1 與mode2的指令
mode1:
RGB燈色
mode2:
RGB燈閃爍
演示影片
沒有留言:
張貼留言