void setup() { pinMode(0, OUTPUT); pinMode(1, OUTPUT); pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(7, OUTPUT); pinMode(8, OUTPUT); pinMode(9, OUTPUT); pinMode(10, OUTPUT); pinMode(11, OUTPUT); pinMode(12, OUTPUT); pinMode(13, OUTPUT); pinMode(14, OUTPUT); pinMode(15, OUTPUT); pinMode(16, OUTPUT); pinMode(17, OUTPUT); pinMode(18, OUTPUT); pinMode(19, OUTPUT); } void setLEDs(long leds) { if (leds & 0b00000000000000000001) digitalWrite(0, HIGH); else digitalWrite(0, LOW); if (leds & 0b00000000000000000010) digitalWrite(1, HIGH); else digitalWrite(1, LOW); if (leds & 0b00000000000000000100) digitalWrite(2, HIGH); else digitalWrite(2, LOW); if (leds & 0b00000000000000001000) digitalWrite(3, HIGH); else digitalWrite(3, LOW); if (leds & 0b00000000000000010000) digitalWrite(4, HIGH); else digitalWrite(4, LOW); if (leds & 0b00000000000000100000) digitalWrite(5, HIGH); else digitalWrite(5, LOW); if (leds & 0b00000000000001000000) digitalWrite(6, HIGH); else digitalWrite(6, LOW); if (leds & 0b00000000000010000000) digitalWrite(7, HIGH); else digitalWrite(7, LOW); if (leds & 0b00000000000100000000) digitalWrite(8, HIGH); else digitalWrite(8, LOW); if (leds & 0b00000000001000000000) digitalWrite(9, HIGH); else digitalWrite(9, LOW); if (leds & 0b00000000010000000000) digitalWrite(10, HIGH); else digitalWrite(10, LOW); if (leds & 0b00000000100000000000) digitalWrite(11, HIGH); else digitalWrite(11, LOW); if (leds & 0b00000001000000000000) digitalWrite(12, HIGH); else digitalWrite(12, LOW); if (leds & 0b00000010000000000000) digitalWrite(13, HIGH); else digitalWrite(13, LOW); if (leds & 0b00000100000000000000) digitalWrite(14, HIGH); else digitalWrite(14, LOW); if (leds & 0b00001000000000000000) digitalWrite(15, HIGH); else digitalWrite(15, LOW); if (leds & 0b00010000000000000000) digitalWrite(16, HIGH); else digitalWrite(16, LOW); if (leds & 0b00100000000000000000) digitalWrite(17, HIGH); else digitalWrite(17, LOW); if (leds & 0b01000000000000000000) digitalWrite(18, HIGH); else digitalWrite(18, LOW); if (leds & 0b10000000000000000000) digitalWrite(19, HIGH); else digitalWrite(19, LOW); } void loop() { setLEDs(0b00000000000000000001); delay(200); setLEDs(0b00000000000000000010); delay(200); setLEDs(0b00000000000000000100); delay(200); setLEDs(0b00000000000000001000); delay(200); setLEDs(0b00000000000000010000); delay(200); setLEDs(0b00000000000000100000); delay(200); setLEDs(0b00000000000001000000); delay(200); setLEDs(0b00000000000010000000); delay(200); setLEDs(0b00000000000100000000); delay(200); setLEDs(0b00000000001000000000); delay(200); setLEDs(0b00000000010000000000); delay(200); setLEDs(0b00000000100000000000); delay(200); setLEDs(0b00000001000000000000); delay(200); setLEDs(0b00000010000000000000); delay(200); setLEDs(0b00000100000000000000); delay(200); setLEDs(0b00001000000000000000); delay(200); setLEDs(0b00010000000000000000); delay(200); setLEDs(0b00100000000000000000); delay(200); setLEDs(0b01000000000000000000); delay(200); setLEDs(0b10000000000000000000); delay(200); }