Martha MigliacioAlex Wong
Published © GPL3+

Using the Pmod LED with Arduino Uno

Application notes for Pmod LED and Arduino Uno. In this app, LEDs will light up one after another before turning off.

BeginnerProtip1 hour671
Using the Pmod LED with Arduino Uno

Things used in this project

Story

Read more

Schematics

Pmod LED and Arduino Uno Fritzing file

Fritzing file displaying the connection of the Pmod LED to the Arduino Uno.

Pmod LED and Arduino Uno Fritzing Image

Fritzing image displaying the connection between the Pmod LED and Arduino Uno.

Code

Pmod LED and Arduino Uno Code

Arduino
Using this code will successfully turn the LEDs on one after another 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);
}

Credits

Martha Migliacio

Martha Migliacio

5 projects • 18 followers
Alex Wong

Alex Wong

14 projects • 53 followers
I work in Digilent and like creating projects
Thanks to Lextronics.

Comments