Skip to content

Tutorial : Fading light

Mélanie Bats edited this page Mar 6, 2014 · 4 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 create a fading LED 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 :

Fading LED Hardware

The DFRduino Uno R3 platform is used, the white LED module is connected to the digital pin 11 of the Arduino board. It is important to connect the LED to a PWM digital pin. PWM is a technique for getting an analog-like behavior from a digital output by switching it off and on very fast.

Sketch

In the sketch, we use the white LED as a Level module.

Fading LED 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.fadelight