1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

M5NanoC6、NeoPixelで遊ぶ。

Posted at

x 過去ログを見よ!!
x Adafruit_NeoPixel.hをインストール

結果

o_coq520.jpg

プログラム

(M5NanoC6専用のライブラリを改造)




//RGB2LED_M5NanoC6_1


/**
 * @file rgb_led.ino
 * @author SeanKwok (shaoxiang@m5stack.com)
 * @brief
 * @version 0.1
 * @date 2024-03-19
 *
 *
 * @Hardwares: M5NanoC6
 * @Platform Version: Arduino ESP32 Board Manager v3.0.0-alpha3
 * @Dependent Library:
 * M5NanoC6: https://github.com/m5stack/M5NanoC6
 * Adafruit_NeoPixel: https://github.com/adafruit/Adafruit_NeoPixel
 */

#include <Adafruit_NeoPixel.h>

#define NUM_LEDS 2
Adafruit_NeoPixel strip(NUM_LEDS, 1, NEO_GRB + NEO_KHZ800);

void setup() {
    // Enable RGB LED Power
    pinMode(1, OUTPUT);
    digitalWrite(1, HIGH);

    strip.begin();
    strip.show();
}

void loop() {
    strip.setPixelColor(0, strip.Color(64, 0, 0));
    //strip.show();
    //delay(100);

    strip.setPixelColor(1, strip.Color(0, 64, 0));
    strip.show();
    delay(100);


    strip.setPixelColor(0, strip.Color(0, 64, 0));
    //strip.show();
    //delay(100);

    strip.setPixelColor(1, strip.Color(0, 0, 64));
    strip.show();
    delay(100);


    // 蓝色
    strip.setPixelColor(0, strip.Color(0, 0, 64));
    //strip.show();
    //delay(100);

    strip.setPixelColor(1, strip.Color(64, 0, 0));
    strip.show();
    delay(100);
}


1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?