Para hacer parpadear un Led por medio de un arduino estan las instrucciones siguientes;
- conectar el cable del arduino a la computadora y en el arduino
- conectar los cables del arduino a la tarjeta donde esta el Led de manera que el cable cafe este en el GND
HIGH es para prender y LOW es para apagar el Led.
Para poner el Led a Parpadear a ritmo normal, insertar el codigo siguiente en Arduino y correr la funcion.
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(3, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(3, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for 0.5 seconds
digitalWrite(3, LOW); // turn the LED off by making the voltage LOW
delay(500); // wait for 0.5 seconds
}
Para incrementar la velocidad del parpadeo del Led, insertar el codigo siguiente en Arduino y correr la funcion.
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(3, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(3, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for 0.1 second
digitalWrite(3, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for 0.1 second
}
y finalmente, para reducir la velocidad del parpadeo, Incertar el codigo siguiente en Arduino y correr la funcion.
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(3, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(3, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1500); // wait for 1.5 seconds
digitalWrite(3, LOW); // turn the LED off by making the voltage LOW
delay(1500); // wait for 1.5 seconds
}