Chapter 1.4 - Blink A LED

Simple loop program to make the left LED flash.

The traditional first program to write is to make a LED light flash. This is a very simple program and as the name suggests turns on and off the left LED light. Drag across the icons to form the program below, then click on each icon and set the properties box as shown. 

EdWare LED blink

How the program works 

Edison’s microcontroller (brain) follows each icon as a step and the arrows show the direction of the steps. Let’s follow the steps in the program above. 

Step 1: the program begins at the start icon  

Step 2: the program follows the arrow out of the top of the loop icon 

Step 3: the LED is set to on by the flash LED icon 

Step 4: the program waits for 0.5 seconds by the event wait icon (keep the LED on) 

Step 5: the LED is set to off by the flash LED icon 

Step 6: the program waits for 0.5 seconds by the event wait icon (keep the LED off) 

Step 7: what happens here is very important! Rather than following the arrow to the right of the loop end icon, the program moves out of the bottom of the icon and goes back to the loop start icon. This happens because the loop icon is set to ‘Loop forever’. The program therefore once again goes to the first flash LED icon and turns on the LED and then follows the same sequence outlined above. This will continue forever or at least until the batteries go flat!