5% OFF Over $19, Code: Elephant5; 10% OFF Over $59, Code: Elephant10



ARDUBLOCK Project 3: Flowing Light

Posted by Fiona Su on

Introduction:
In this project, we use graphical programming to control 3 LED module . Light up and dim them according to given sequence and time, gaining a visual effect of flowing light.
Materials Required:

  • 1. KEYESTUDIO UNO Control Board *1
  • 2. V5 Sensor Shield*1
  • 3. Piranha LED*3
  • 4. Female to Female Dupont Line*9

Connection Diagram:

thumb

thumb

After wiring, we can start programming.

thumb

Click “download to Arduino” to see the codes in Aduino interface.
Sample Code:

*****************************************************************************
void setup()
{
  pinMode( 3 , INPUT);
  pinMode( 2 , INPUT);
  pinMode( 4 , INPUT);
  pinMode( 2 , OUTPUT);
  pinMode( 3 , OUTPUT);
  pinMode( 4 , OUTPUT);
}

void loop()
{
  digitalWrite( 2 , !( digitalRead(2) ) );
  delay( 500 );
  digitalWrite( 3 , !( digitalRead(3) ) );
  delay( 500 );
  digitalWrite( 4 , !( digitalRead(4) ) );
  delay( 500 );
}
*******************************************************************************

Result:
To realize flowing light function, we should connect three high bright LED module of IO port.

 

All Projects

Buy it >> ARDUBLOCK Graphical Programming Starter Kit for Arduino

0 comments

Leave a comment

Please note, comments must be approved before they are published