You are on page 1of 4

Int matriz [] = (2,3,4,5,6,7,8,9);

Int cont = 9;

Int po = 0;

Int antes = 0;

Vold setup() (

for (pos = 0; pos < cont; pos++)

PinMode (matriz[pos], OUTPUT);

vold loop () (

for (pos =0; pos < cont; pos++)

antes = pos -1;

digitalWrite (matriz[pos], HIGH);

delay (100);

digitalWrite (matriz[antes], LOW);

delay (500);

)
CEMAFORO
nt LED_ROJO=2;

int LED_AMARILLO=3;

int LED_VERDE=4;

void setup(){

pinMode(LED_ROJO, OUTPUT);

pinMode(LED_AMARILLO, OUTPUT);

pinMode(LED_VERDE, OUTPUT);

digitalWrite(LED_ROJO, LOW);

digitalWrite(LED_AMARILLO, LOW);

digitalWrite(LED_VERDE, LOW);

void loop(){

digitalWrite(LED_VERDE, HIGH);

delay(500);

digitalWrite(LED_VERDE, LOW);

digitalWrite(LED_AMARILLO, HIGH);

delay(500);

digitalWrite(LED_AMARILLO, LOW);

digitalWrite(LED_ROJO, HIGH);

delay(500);

digitalWrite(LED_ROJO, LOW);

digitalWrite(LED_VERDE, LOW);

}
int LED_ROJO=2;

int LED_AMARILLO=3;

int LED_VERDE=4;

void setup(){

pinMode(LED_ROJO, OUTPUT);

pinMode(LED_AMARILLO, OUTPUT);

pinMode(LED_VERDE, OUTPUT);

digitalWrite(LED_ROJO, LOW);

digitalWrite(LED_AMARILLO, LOW);

digitalWrite(LED_VERDE, LOW);

void loop(){

digitalWrite(LED_VERDE, HIGH);

delay(2000);

digitalWrite(LED_VERDE, LOW);

digitalWrite(LED_AMARILLO, HIGH);

delay(500);

digitalWrite(LED_AMARILLO, LOW);

digitalWrite(LED_ROJO, HIGH);

delay(1000);

digitalWrite(LED_ROJO, LOW);