0
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?

More than 1 year has passed since last update.

M5Atom S3 / Lite のLED ピン番号

Last updated at Posted at 2023-09-23

LEDのピン番号がわかると、M5ライブラリを使わずにLEDを光らせることができます。

LEDパワーピン(pinMode(NEO_PWR,OUTPUT); digitalWrite(NEO_PWR, HIGH);で通電)およびデータピン(Adafruit_NeoPixel pixels(, データピン, );で点灯)は以下の通りです。

M5AtomS3.
POWER_PIN 16
DATA_PIN  35
M5Atom.
POWER_PIN --(最初から通電?)
DATA_PIN  27

おまけ

XIAO RP2040.
POWER_PIN 11
DATA_PIN  12
#include <Arduino.h>
#include <Adafruit_NeoPixel.h>

#define INI_ATOMS3
#ifdef INI_ATOMS3
#define NEO_PWR (16)
#define NEOPIX (35)
#endif
#ifdef INI_ATOM
#define NEO_PWR (26)
#define NEOPIX (27)
#endif
#ifdef INI_XIAO_RP2040
#define NEO_PWR (11)
#define NEOPIX (12)
#endif

#define NUMPIXELS 1
Adafruit_NeoPixel pixels(NUMPIXELS, NEOPIX, NEO_GRB + NEO_KHZ800);

void setup() {
  pinMode(NEO_PWR,OUTPUT);  digitalWrite(NEO_PWR, HIGH);
  pixels.begin();
  pixels.setBrightness(20);
  delay(100);
}

void loop() {
  pixels.setPixelColor(0, pixels.Color(0, 55, 0));
  delay(100);
  pixels.setPixelColor(0, pixels.Color(0, 0, 0));
  delay(100);
}
0
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
0
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?