144 Views
June 25, 17
スライド概要
2017/06/24(土) 旭川/ゆるくLTをしよう
tomio2480 です
部屋 @TOMIO2480
暗い
明るい
DTM用の鍵盤
ひけない
かわいい
きたない
便利
https://habitica.com/
はたらけ
2.1 ch
高低差に感謝
金で解決
雑な間接照明
コンセント
筋力の無駄
PCでON/OFF
秋月電子から出ているキット http://akizukidenshi.com/catalog/g/gK-00203/
sketch_jun24a §
1 void setup() {
2 pinMode(13, OUTPUT);
3 Serial.begin(9600);
4 digitalWrite(13, LOW);
5 }
6 void loop() {
7 if (Serial.available() > 0) {
8 char input = char(Serial.read());
9
10 if(input == '?') {
11 Serial.print("The light bulb is ");
12 Serial.println((digitalRead(13)) ? "ON." : "OFF.");
13 Serial.println("Please send 'n' to attach a light bulb.");
14 Serial.println("To turn off the light bulb, please send something other than 'n'.");
15 }
16 else {
17 digitalWrite(13, (input == 'n') ? HIGH : LOW);
18 Serial.println((input == 'n') ? "ON" : "OFF");
19 }
20 }
21 }
電球つける Demo
sketch_jun24a §
1 void setup() {
2 pinMode(13, OUTPUT);
3 Serial.begin(9600);
4 digitalWrite(13, LOW);
5 }
6 void loop() {
7 if (Serial.available() > 0) {
8 char input = char(Serial.read());
9
10 if(input == '?') {
11 Serial.print("The light bulb is ");
12 Serial.println((digitalRead(13)) ? "ON." : "OFF.");
13 Serial.println("Please send 'n' to attach a light bulb.");
14 Serial.println("To turn off the light bulb, please send something other than 'n'.");
15 }
16 else {
17 digitalWrite(13, (input == 'n') ? HIGH : LOW);
18 Serial.println((input == 'n') ? "ON" : "OFF");
19 }
20 }
21 }
無駄なHELP
スイッチを押す
筋力の無駄
キーボード
必須運動
みんなも つくろう