Skip to content

Instantly share code, notes, and snippets.

@lazytomatolab
Created December 23, 2018 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lazytomatolab/59a3508f71f5de90c67fca26d1194fd9 to your computer and use it in GitHub Desktop.
Save lazytomatolab/59a3508f71f5de90c67fca26d1194fd9 to your computer and use it in GitHub Desktop.
【Arduino SpeedUp】快速上手 Class 13 - 迴圈 for 讓你功力大提升!更多資訊請造訪:http://www.lazytomatolab.com
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() {
}
void setup() {
Serial.begin(115200);
for(int counter = 0; counter < 10; counter++) {
Serial.println("LazyTomato Lab");
}
}
void loop() {
}
void setup() {
Serial.begin(115200);
for(int counter = 0; counter < 10; counter++) {
Serial.println(counter);
}
}
void loop() {
}
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