いろいろ、注意
- 過去ログをみょ!!!
- Adafruit NeoPixelをインストール
目的
M5Stack社製のGROVEシステム RGB LEDを光らせて遊ぶ
結果
プログラム
//rgb_led_XIAO_ESP32C6_2
//インクルド
#include <Arduino.h>
#include <Adafruit_NeoPixel.h>
//定義
#define NUM_LEDS 3
#define OUT_GPIO_NUM D10 //XIAO-ESP32C6
Adafruit_NeoPixel strip(NUM_LEDS, OUT_GPIO_NUM, NEO_GRB + NEO_KHZ800);
//初期化
void setup() {
// put your setup code here, to run once:
//ネオピクセルの設定
strip.begin();
strip.show();
//カラーセット
strip.setPixelColor(0, strip.Color( 5, 0, 0));
strip.setPixelColor(1, strip.Color( 0, 5, 0));
strip.setPixelColor(2, strip.Color( 0, 0, 5));
strip.show();//再表示
}//setup
//メインループ
void loop() {
// put your main code here, to run repeatedly:
delay(3); //ダミー
}//loop