Goal of this example is to demonstrate how to create a blinking LED using basic flowchart elements.
You will need:
- Any Raspberry Pi board
- USB cable to connect the board to your computer
- Any LED
- 220 Ohm resistor
- Breadboard and jumper wires
Wiring Diagram:
How to make it work:
The flowchart will consists of the following elements:
- 1x Start: Initializes the program.
- 2x Switch: Controls the LED state (ON/OFF).
- 2x Wait: Introduces delays for blinking effect.
- 1x End: Terminates the program.
Flowchart Logic:
- The program starts with the Start element.
- It then enters a loop where it turns the LED ON using the first Switch element.
- The program waits for 1 second using the first Wait element.
- Next, it turns the LED OFF using the second Switch element.
- It waits for another 1 second using the second Wait element.
- This loop continues indefinitely until the program is manually stopped or terminated using the End element.
Creating the Flowchart:
- Create new varible by clicking the "Variables" button in the main window toolbar.
Name it however u want and set its type to Boolean.
- Create new device by clicking the "Devices" button in the main window toolbar.
Name it LED for convenience and set its type to Output.
- To add new elements to the canvas, click the "Elements" button in the main window toolbar, then click "add Element".
- Select the required elements from the list and place them on the canvas.
- Connect the elements in the following order:
- "Start → While", make sure to set the condition to True to create an infinite loop.
- "While (Connect to top connection point) → Switch (LED ON)"
- "While (Connect to bottom connection point) → End"
- "Switch (LED ON) → Wait (1s)", this will keep the LED on for 1 second.
- "Wait (1s) → Switch (LED OFF)", this will turn the LED off.
- "Switch (LED OFF) → Wait (1s)", this will keep the LED off for 1 second.
- "Wait (1s) → End", always make sure to properly terminate the program.
Flowchart Diagram: