1
1

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のライブラリーで遊ぶ。(M5NanoC6.h)

Last updated at Posted at 2024-10-09

参考

↓クリック

↑クリック

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

インストール

o_coq500.jpg

o_coq499.jpg

o_coq501.jpg

結果

o_coq502.jpg

プログラム



/**
 * @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 <M5NanoC6.h>
#include <Adafruit_NeoPixel.h>

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

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

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

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

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

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



1
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?