teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

詳細

2018/03/06 07:10

投稿

band20010518
band20010518

スコア14

title CHANGED
@@ -1,1 +1,1 @@
1
- 500ミリ秒間赤色LEDのみがオンになってから両方のLEDがオフになり最後に緑色LEDのみが500ミリ秒間オンになるようにするにはどうすればいいですか?
1
+ 500ミリ秒間赤色LEDのみがオンになってから両方のLEDがオフになり最後に緑色LEDのみが500ミリ秒間オンにするにはどうすればいいですか?
body CHANGED
@@ -1,2 +1,22 @@
1
- https://docs.google.com/document/d/17eb6FmhQtbtvvpqHqd5ert0NjaL7A9bYr2raWoQpi8A/edit
1
+ int redPin = 12; // Red LED connected to digital pin 12
2
+ int greenPin = 11; // Green LED connected to digital pin 11
3
+
4
+ void setup() // run once, when the sketch starts
5
+ {
6
+ pinMode(redPin, OUTPUT); // sets the digital pin as output
7
+ pinMode(greenPin, OUTPUT); // sets the digital pin as output
8
+ }
9
+
10
+ void loop() // run over and over again
11
+ {
12
+ digitalWrite(redPin, HIGH); // sets the Red LED on
13
+ digitalWrite(greenPin, HIGH); // sets the Green LED on
14
+ delay(500); // waits for half a second
15
+ digitalWrite(greenPin, LOW); // sets the Green LED off
16
+ delay(500); // waits for half a second
17
+ digitalWrite(redPin, LOW); // sets the Red LED off
18
+ delay(500); // waits for half a second
19
+ digitalWrite(greenPin,HIGH) // sets the Green LED on
20
+ delay(500); // waits for half a second
21
+ }
2
- をクリックしてください。コード試したのですができませんでした。どこがエラー出たわかりま
22
+ このコード試したのですができませんでした。どこが違ってる教えてほしいで

1

webサイト

2018/03/06 07:10

投稿

band20010518
band20010518

スコア14

title CHANGED
File without changes
body CHANGED
@@ -1,2 +1,2 @@
1
- https://docs.google.com/document/d/17eb6FmhQtbtvvpqHqd5ert0NjaL7A9bYr2raWoQpi8A/edit
1
+ https://docs.google.com/document/d/17eb6FmhQtbtvvpqHqd5ert0NjaL7A9bYr2raWoQpi8A/edit
2
2
  をクリックしてください。コードを試したのですができませんでした。どこがエラー出たかわかります。