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 3 years have passed since last update.

M5StickC PlusでGrove LED Socket Kit (Lチカ)を試す

Posted at

#1. 外観

1秒点灯、1秒消灯を繰り返すLEDチカチカを作ります。

DSC_0235_2.JPG

#2. 環境

#3. 接続

Groveの4ピンケーブルで接続するだけなのですが、表にしておきます。

M5StickC Plus Grove LED Socket Kit Memo
G (GND) GND -
V OUT (5V) VCC +
G32 NC 接続なし
G33 SIG 信号

#4. スケッチ

Grove_LED_Socket_Kit.ino
#include <M5StickCPlus.h>

#define SIG_PIN 33          // G33 --> SIG

void setup() {
  M5.begin();
  M5.Axp.ScreenBreath(8);   // 画面の明るさ
  M5.Lcd.setRotation(1);    // 画面の向き
  M5.Lcd.setTextSize(2);    // 文字の大きさ

  pinMode(SIG_PIN, OUTPUT);
  delay(1000);
}

void loop() {
  digitalWrite(SIG_PIN, HIGH);  // 点灯
  M5.Lcd.fillScreen(BLACK);     // 画面塗りつぶし
  M5.Lcd.setCursor(10, 10);     // カーソル座標指定
  M5.Lcd.print("HIGH");
  delay(1000);

  digitalWrite(SIG_PIN, LOW);   // 消灯
  M5.Lcd.fillScreen(BLACK);
  M5.Lcd.setCursor(10, 10);
  M5.Lcd.print("LOW");
  delay(1000);
}

以上です。

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?