logo

domenica 24 ottobre 2010

Il Semaforo Arduino

semaforo
// Semaforo
int ledDelay = 10000;
int SrossoPin = 7;
int SgialloPin = 6;
int SVerdePin = 5;
void setup() {
pinMode(SrossoPin, OUTPUT);
pinMode(SgialloPin, OUTPUT);
pinMode(SverdePin, OUTPUT);
}
void loop()
{
digitalWrite(SrossoPin, HIGH);
delay(ledDelay);
digitalWrite(SrossoPin, LOW);
digitalWrite(Sgiallo, HIGH);
delay(ledDelay);
digitalWrite(SgialloPin, LOW);
digitalWrite(SverdePin, HIGH);
delay(ledDelay);
digitalWrite(SverdePin, LOW);
digitalWrite(SgialloPin, HIGH);
delay(2000);
digitalWrite(SgialloPin, LOW);
}

Nessun commento:

Posta un commento