参考
x 過去ログを見よ!!!
x 3.1.0
//2button_test1_M5StampS3_1
//インクルド
#include <Arduino.h>
//初期化
void setup() {
// put your setup code here, to run once:
//GPIOの初期化
pinMode(21, OUTPUT);
pinMode(13, INPUT);
pinMode(15, INPUT);
}//setup
//メインループ
void loop() {
// put your main code here, to run repeatedly:
int a = digitalRead(15); //ボタンの読み込み
int b = digitalRead(13); //ボタンの読み込み
if ( a != 0 && b == 0 ) {
neopixelWrite(21, 64, 0, 0);
} else if ( a == 0 && b != 0 ) {
neopixelWrite(21, 0, 0, 64);
} else if ( a == 0 && b == 0 ) {
neopixelWrite(21, 64, 0, 64);
} else {
neopixelWrite(21, 0, 0, 0);
} //endif
delay(10); // 1 / 100 秒待つ
}//loop