質問編集履歴
1
試したことの修正。一度参考記事内のソースコード通りにやって動かなかったことを確認後、シリアルモニタでの動作確認としてSerial.println()を追記。
title
CHANGED
File without changes
|
body
CHANGED
@@ -12,8 +12,8 @@
|
|
12
12
|
|
13
13
|
### 試したこと
|
14
14
|
上記リンクの手順を辿り、以下のコードを書きました。
|
15
|
-
Arduinoへのコンパイル・書き込みは正常に終了し、
|
15
|
+
Arduinoへのコンパイル・書き込みは正常に終了しましたが、switchに接続しても動作しませんでした。
|
16
|
-
|
16
|
+
|
17
17
|
```arduino
|
18
18
|
#include <SwitchControlLibrary.h>
|
19
19
|
|
@@ -25,6 +25,25 @@
|
|
25
25
|
void loop() {
|
26
26
|
// put your main code here, to run repeatedly:
|
27
27
|
SwitchControlLibrary().PressButtonA();
|
28
|
+
delay(30);
|
29
|
+
SwitchControlLibrary().ReleaseButtonA();
|
30
|
+
delay(150);
|
31
|
+
}
|
32
|
+
```
|
33
|
+
|
34
|
+
その後、そもそも動いているのかの確認として以下のコードを書いたところ、
|
35
|
+
シリアルモニタで"アイウエオ"、"かきくけこ"の出力は確認出来ました。
|
36
|
+
```arduino
|
37
|
+
#include <SwitchControlLibrary.h>
|
38
|
+
|
39
|
+
void setup() {
|
40
|
+
// put your setup code here, to run once:
|
41
|
+
|
42
|
+
}
|
43
|
+
|
44
|
+
void loop() {
|
45
|
+
// put your main code here, to run repeatedly:
|
46
|
+
SwitchControlLibrary().PressButtonA();
|
28
47
|
Serial.println("アイウエオ");
|
29
48
|
delay(30);
|
30
49
|
SwitchControlLibrary().ReleaseButtonA();
|
@@ -32,6 +51,7 @@
|
|
32
51
|
delay(150);
|
33
52
|
}
|
34
53
|
```
|
54
|
+
|
35
55
|
boards.txtは以下二つとも書き換えました。
|
36
56
|
```
|
37
57
|
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/boards.txt
|