Primer Programa Arduino
Enviado por lalo1234 • 9 de Diciembre de 2013 • 239 Palabras (1 Páginas) • 368 Visitas
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led1 = 13;
int led2 = 12;
int led3 = 11;
int led4 = 10;
int led5 = 9;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
delay (300);
digitalWrite(led1, HIGH);
delay (300);
digitalWrite(led2, HIGH);
delay (300);
digitalWrite(led3, HIGH);
delay (300);
digitalWrite(led4, HIGH);
delay (300);
digitalWrite(led5, HIGH);
delay (300);
digitalWrite(led1, LOW);
delay (300);
digitalWrite(led2, LOW);
delay (300);
digitalWrite(led3, LOW);
delay (300);
digitalWrite(led4, LOW);
delay (300);
digitalWrite(led5, LOW);
}
...