|
看如下官方例程Blinker_RGB 怎么对应R、G、B 引脚没有具体说明? 找了半天没找到Pin定义啊。。。
#define RGB_1 "RGBKey"
BlinkerRGB RGB1(RGB_1);
void rgb1_callback(uint8_t r_value, uint8_t g_value, uint8_t b_value, uint8_t bright_value)
{
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
BLINKER_LOG("R value: ", r_value);
BLINKER_LOG("G value: ", g_value);
BLINKER_LOG("B value: ", b_value);
BLINKER_LOG("Rrightness value: ", bright_value);
}
void dataRead(const String & data)
{
BLINKER_LOG("Blinker readString: ", data);
Blinker.vibrate();
uint32_t BlinkerTime = millis();
Blinker.print(BlinkerTime);
Blinker.print("millis", BlinkerTime);
RGB1.brightness(random(0, 255));
RGB1.print(random(0, 255), random(0, 255), random(0, 255));
}
void setup()
{
Serial.begin(115200);
BLINKER_DEBUG.stream(Serial);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
Blinker.begin(auth, ssid, pswd);
Blinker.attachData(dataRead);
RGB1.attach(rgb1_callback);
}
void loop()
{
Blinker.run();
}
|
|