PCEval / esp32 /level1 /bar_led_basic /src /main_esp.cpp
eunzee's picture
upload Arduino Uno and ESP32 project files
8e53a3e verified
Raw History Blame Contribute Delete
402 Bytes
/**
Use bar LED
10 APR 2025 by Blind Author
*/
#include <Arduino.h>
int pinList[] = {2, 4, 5, 12, 13, 14, 18, 19, 21, 22};
int threshold = 6;
void setup() {
for (int i=0; i<10; i++) {
pinMode(pinList[i], OUTPUT);
}
for (int i=0; i<10; i++) {
if (i < threshold) {
digitalWrite(pinList[i], HIGH);
} else {
digitalWrite(pinList[i], LOW);
}
}
}
void loop() {
}