User manual

form a voltage divider that can deliver any desired voltage between 0V and +5V. However, this analogue voltage cannot be passed on directly to
the LED, but rather needs to be converted into a digital PWM value.
The analogue inputs of the Arduino evaluate an analogue voltage value and deliver digital values between 0 and 1023. Here 0 stands for 0V and
1023 for +5V voltage at the respective pin. These values must be converted to values between 0 and 255 for them to then outputted again as
PWM value at an LED.
The programme
An infinite loop reads the value of analogue Pin 5 and divides it by 4. The result is stored in the variable x and displayed on the platform. Then
the PWM Pin9 is set to this value.
The programme 14dimm01 dims an LED
using the setting of the potentiometer.
Day 15
Today on the Advent calendar
2xconnection cables
Analogue level indicator with LEDs
Components: 1xbreadboard, 2xred LED, 2x yellow LED, 2x green LED, 1x blue LED, 7x220-ohm resistor (red-red-brown), 1x15-kohm
potentiometer, 10xconnection cable, 1x insulated jumper
Level indicator with seven LEDs
Now you know how to control the brightness of an LED with analogue values. To really visualise an analogue value, however, this method is not
expressive enough – brightnesses are perceived very subjectively and depend heavily on the surroundings and the LEDs used. Analogue values
can be read much more clearly on a level indicator.
The programme
The numbers of the pins used for the LEDs are stored in a list. The analogue Pin 5 is continually queried and its value, which can lie between 0
and 1023, is divided by 128 to get a value between 0 and 8 and thereby switch on 0 to 7 LEDs.
An inner loop over the length of the list checks whether the value p calculated in this way is higher than the current number of the LED. If yes,
the LED is switched on.
The programme 15pegel controls an LED strip
using the setting of the potentiometer.
Day 16
Today on the Advent calendar
7-segment indicator
Controlling a 7-segment indicator with the Arduino
7-segment indicators can display the digits from 0 to 9 as well as the letters A through F, which are necessary to represent hexadecimals, on seven LEDs.
The 7-segment indicator on the Advent calendar also has, as many such display modules do, an eighth LED for the decimal point. The seven LEDs for the
digit representation are labelled with the letters a through g. The LED marked DP represents the decimal point. With a single-digit 7-segment indicator,
each LED can be controlled individually via its anode. All LEDs of a 7-segment indicator of the Common Cathode type use a common cathode, similar to
RGB LEDs.
Components: 1xbreadboard, 1x7-segment indicator, 7x220-ohm resistor (red-red-brown), 8xconnection cable, 1xinsulated jumper