This commit is contained in:
wancat
2022-03-16 10:54:01 +08:00
parent 7cf9de2f1d
commit d56ea0dab0
4 changed files with 193 additions and 0 deletions

17
week4-1/week4-1.ino Normal file
View File

@@ -0,0 +1,17 @@
const int LED[] = {11, 10, 9, 8, 7, 6, 5, 4};
void setup() {
for (int i = 0; i < 8; i++) {
pinMode(LED[i], OUTPUT);
digitalWrite(LED[i], HIGH);
}
}
void loop() {
static bool clk = 0;
for (int i = 0; i < 8; i++) {
digitalWrite(LED[i], i % 2 == clk);
}
delay(250);
clk = !clk;
}