Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Hackster is hosting Impact Spotlights: Smart Home. Watch the stream live on Thursday!Hackster is hosting Impact Spotlights: Smart Home. Stream on Thursday!
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 hour692
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
5 projects • 21 followers
Contact
Alex Wong
14 projects • 55 followers
I work in Digilent and like creating projects
Contact
Thanks to Lextronics.

Comments

Please log in or sign up to comment.