//tips
//Biz
営業ストック。狩猟読本周回。カモの名前難しい。
Stable diffusionにはまる。
防犯ベル点検のためお家待機。
バトルタワーがない。Nintendo 会員どうするか悩む。
スプラありか?
Iot
スライドボタンの代わりになるかと思って備え付けを使ったがダメだった。
ちょうどいい装置がないとむずいな。
int SW_PIN = 2;
void setup() {
// put your setup code here, to run once:
pinMode(SW_PIN,INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(SW_PIN)==HIGH){
Serial.println("ON");
}else{
Serial.println("OFF");
}
delay(1000);
}
こうして5vを使わずpinからのダイレクト電流にしたらでけた。
int SW_PIN = 4;
void setup() {
// put your setup code here, to run once:
pinMode(SW_PIN,INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(SW_PIN)==HIGH){
Serial.println("ON");
}else{
Serial.println("OFF");
}
delay(1000);
}
磁石を用いたリードスイッチは仕掛けに使えそう。