Introduction: Visuino How to Use a Button As an Input to Control Things Like LED
In this tutorial we will learn how to Turn the LED ON and OFF using a simple button and Visuino.
Watch a demonstration video.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: What You Will Need
- Arduino UNO (or any other Arduino)
- Jumper wires
- Resistor 1k ohm (or something similar)
- Visuino program: Download Visuino
Step 2: The Circuit
- Connect Arduino Pin 5V to breadboard positive pin (red line)
- Connect Arduino Pin GND to breadboard negative pin (blue line)
- Connect Arduino Digital pin 13 to LED positive pin
- Connect LED negative pin to Breadboard negative pin (blue line)
- Connect button first pin to breadboard positive pin (red line)
- Connect button second pin to arduino digital pin 7
- Connect button second pin to resistor
- Connect resistor to breadboard negative pin (blue line)
Step 3: Start Visuino, and Select the Arduino UNO Board Type
To start programming the Arduino, you will need to have the Arduino IDE installed from here: https://www.arduino.cc/.
Please be aware that there are some critical bugs in Arduino IDE 1.6.6. Make sure that you install 1.6.7 or higher, otherwise this Instructable will not work! If you have not done follow the steps in this Instructable to setup the Arduino IDE to program Arduino UNO! The Visuino: https://www.visuino.eu also needs to be installed. Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2
Step 4: In Visuino Add Components and Connect Them
- Add "Detect Edge" component
- Add "(T) Flip-Flop" component
- Connect Arduino Digital Out pin  to "DetectEdge1" component pin[In]
- Connect "DetectEdge1" component pin[Out] to "TFlipFlop1" component pin[Clock]
- Connect "TFlipFlop1" component pin[Out] to Arduino Digital IN pin
Step 5: Generate, Compile, and Upload the Arduino Code
In Visuino, Press F9 or click on the button shown on Picture 1 to generate the Arduino code, and open the Arduino IDE
In the Arduino IDE, click on the Upload button, to compile and upload the code (Picture 2)
Step 6: Play
If you power the Arduino UNO module, you will be able to turn the LED ON or OFF by pressing a button.
Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it here.
You can download and open it in Visuino: https://www.visuino.eu