20663985_746201858897746_4897837099155598362_n.jpg
Código 3
por DANIEL GUIMARÃES MENDES - sexta, 25 agosto 2017, 16:05
 

//Projeto 3 - Semáforo

int ledDelay=10000;   //espera entre as alterações

int redPin= 10;

int yellowPin =  9;

int greenPin = 8;

void setup() {

pinMode(redpin, OUTPUT);

pinMode(yellow, UOTPUT);

pinMode(greenPin, OUTPUT);

}

void loop() {

digitalWrite(redPin, HIGH);  //acende a luz vermalha

deplay(ledDelay                //espera 5 segundos

digitalWrite(yellowPin, HIGH)  //acende a luz amarela

delay(2000)                          //espera 2 segundos

digitalWrite(greenPin, HIGH);  //apaga a luz verde

digitalWrite(redPin, LOW);  //apagar a luz vermelha

digitalWrite(yellowPin, LOW);  //apaga a luz amarela

delay(2000);                         //espera 2 segundos

digitalWrite(yellowPin, HIGH);  //acender a luz amarela

digitalWrite(greenPin, LOW);   //apagar a luz verde

delay(2000);                         //esperar 2 segundos

digitalWrite(yellowPin, LOW);  //apagar a luz amarela

                                           //agora nosso loop se repete

}

Roberto Dambros
Re: Código 3
por Roberto Dambros - sexta, 25 agosto 2017, 16:33
 

sketch_aug25g.ino: In function 'void setup()':
sketch_aug25g:13: error: 'redpin' was not declared in this scope
sketch_aug25g:15: error: 'yellow' was not declared in this scope
sketch_aug25g:15: error: 'UOTPUT' was not declared in this scope
sketch_aug25g.ino: In function 'void loop()':
sketch_aug25g:27: error: expected `)' before 'digitalWrite'