Skip to content

Tutorial : Simple input (push button)

Mélanie Bats edited this page Mar 6, 2014 · 3 revisions

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 :

Simple input Hardware

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.

Simple input Sketch

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