Tutorial : Simple input (push button) - mbats/arduino GitHub Wiki
If you do not know how to create a new project have a look to the tutorial How to create a new project ?.
In this tutorial we will see how to use a push button to set an LED on/off with the Arduino Designer.
Hardware
In this example we use the Arduino Uno platform and hardware components from the DFRobot Ardublock kit.
The hardware is defined as below :
The DFRduino Uno R3
platform is used, the blue LED
module is connected to the digital pin 13
and the push button
is connected to the digital pin 0
of the Arduino board.
Sketch
In the sketch, we use the blue LED as a Level module and we connect the push button sensor as an entry to the blue LED.
Upload
Finally, click on the Upload
button from the toolbar to upload the code to the Arduino board.
The source of this example are available in : https://github.com/mbats/arduino/tree/master/examples/fr.obeo.dsl.arduino.examples.simpleinput