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