Update your browser to view this website correctly. Update my browser now
int low = 10;
int high = 9;
void setup() {
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
}
int on_time = 20; //in ms
int refresh_rate = 1; // per second
int pins = 3;
int off_time = (1000 / (refresh_rate * (pins + 1))) - on_time; //in ms
void loop() {
for (int pin = 0; pin <= pins; pin++) {
digitalWrite(pin, HIGH);
delay(on_time);
digitalWrite(pin, LOW);
delay(off_time);