void setup() {
// put your setup code here, to run once:
DDRD = 0xFF; //Configura todos los pines del puerto D como salidas
}
void loop() {
// Primer recorrido del pendulo
PORTD = 128; delay(500); //Led 1
PORTD = 64; delay(20); //Led 2
PORTD = 0b00100000; delay(20); //Led 3
PORTD = 0x10; delay(20); //Led 4
PORTD = 0x08; delay(20); //Led 5
PORTD = 0b00000100; delay(20); //Led 6
PORTD = 2; delay(20); //Led 7
PORTD = 0b00000001; delay(500); //Led 8
// segundo recorrido del pendulo
PORTD = 2; delay(20);
PORTD = 4; delay(20);
PORTD = 0x08; delay(20);
PORTD = 0b00010000; delay(20);
PORTD = 32; delay(20);
PORTD = 0b01000000; delay(20);
}