Created
December 23, 2018 12:20
-
-
Save lazytomatolab/59a3508f71f5de90c67fca26d1194fd9 to your computer and use it in GitHub Desktop.
【Arduino SpeedUp】快速上手 Class 13 - 迴圈 for 讓你功力大提升!更多資訊請造訪:http://www.lazytomatolab.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
pinMode(13, OUTPUT); | |
digitalWrite(13, LOW); | |
for(int counter = 0; counter < 10; counter++) { | |
digitalWrite(13, HIGH); | |
delay(200); | |
digitalWrite(13, LOW); | |
delay(200); | |
} | |
} | |
void loop() { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
Serial.begin(115200); | |
for(int counter = 0; counter < 10; counter++) { | |
Serial.println("LazyTomato Lab"); | |
} | |
} | |
void loop() { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
Serial.begin(115200); | |
for(int counter = 0; counter < 10; counter++) { | |
Serial.println(counter); | |
} | |
} | |
void loop() { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int timer = 100; | |
void setup() { | |
for(int thisPin = 2; thisPin < 8; thisPin++) { | |
pinMode(thisPin, OUTPUT); | |
} | |
} | |
void loop() { | |
for(int thisPin = 2; thisPin < 8; thisPin++) { | |
digitalWrite(thisPin, HIGH); | |
delay(timer); | |
digitalWrite(thisPin, LOW); | |
} | |
for(int thisPin = 7; thisPin >= 2; thisPin--) { | |
digitalWrite(thisPin, HIGH); | |
delay(timer); | |
digitalWrite(thisPin, LOW); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment