In this lesson we will use Arduino to drive 4 LEDs  and make a running LED light row.

Plug OSOYOO Magic I/O Shield v1.1 into OSOYOO UNO Board as the picture show:

Then you can wire plug  your LEDs  as below :

Note:

You should NOT connect a  normal LED between 5V and GND  pins in Arduino without a resistance. First, This will cause too much current passing through LED and burn it out. Second, the LED polarity is wrongly connected(i.e Positive Pin connected to GND pin) will also damage the LED.

To solve such problem.  we designed OSOYOO LED module which has a build-in resistance to limit the current and fixed polarity socket to avoid these mistakes.  In this project, we will use OSOYOO LED module.

After  you have connected LED to Magic I/O shield as per  above wiring diagram , please do graphic programming as per following instructions:

  1. Click “In/Out” block;
  2. Drag the “DigitalWrite Pin#” to the blank space, and edit the parameter to “DigitalWrite Pin# 2 Stat HIGH“;
  3. Click “Control” block;
  4. Drag the “Delay” block below “DigitalWrite Pin#” block, fit the two blocks, and edit the parameter to“Delay ms 200” ;
  5. Click “In/Out” block;
  6. Drag the “DigitalWrite Pin#” to the blank space, and edit the parameter to “DigitalWrite Pin# 2 Stat LOW“.

Repeat above operations (or just right click to duplicate the blocks), and define PIN 3, PIN 4 and PIN 5, just remember to change the parameter, the whole program blocks are as following:

Click Save after all the program blocks are installed. Select correct board type and serial port , then click  upload.

how_to_play.png (1150×56)

Now, you should see four LEDs lighting one by one  as per following video, this whole process will repeat until the circuit is powered off.