This application note was designed to use the Arduino Uno to turn on LEDs one after the another on the Pmod LED before turning off.
Thanks to Lextronics.
Application notes for Pmod LED and Arduino Uno. In this app, LEDs will light up one after another before turning off.
Hardware components | ||||||
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
Software apps and online services | ||||||
![]() |
|
This application note was designed to use the Arduino Uno to turn on LEDs one after the another on the Pmod LED before turning off.
/************************************************************************
*
* Test of the Pmod LED
*
*************************************************************************
* Description: Pmod_LED
* LEDs light successively one after the other,
* and then turn off.
*
* Material
* 1. Arduino Uno
* 2. Pmod LED
*
************************************************************************/
void setup()
{
for (int i=2; i<=5; i++) // configuration of pins 2 to 5 in output
{
pinMode(i,OUTPUT);
}
}
void loop()
{
for(int i = 2; i<=5; i++) // 4 LEDs turn on
{
digitalWrite(i,HIGH);
delay(250);
}
for(int i = 2; i<=5; i++) // 4 LEDs turn off
{
digitalWrite(i,LOW);
}
delay(250);
}
Comments