User manual
Today on the Advent calendar
• Yellow LED
• 220-ohm resistor (red-red-brown)
• Connection cable
Stop light
The experiment of the third day switches a traffic light made of three LEDs in their typical cycle of red through red-yellow to green and through
yellow back to red.
Components: 1xbreadboard, 1xred LED, 1x yellow LED, 1x green LED, 3x220-ohm resistor (red-red-brown), 4xconnection cable
The programme
The programme functions similarly to the one from yesterday. Here, too, various combinations of LEDs are switched on and off in sequence in an
infinite loop. In the intermediate phases red-yellow and yellow, the traffic light lights up for 0.5 seconds each time, in the red and green phases 3
seconds each. These times can also be set differently in the wait...sec blocks.
The delay time between the apparently simultaneous switching of multiple LEDs was reduced to 0.01 seconds, which is technically sufficient and
is practically no longer recognisable by the observer.
The programme 03ampel01 causes the LEDs to flash alternately.
Day 4
Today on the Advent calendar
• RGB LED
RGB LED flashes colourfully
The experiment for the fourth day causes an RGB LED to flash in a series of different colours.
Components: 1xbreadboard, 1xRGB LED, 3x220-ohm resistor (red-red-brown), 4xconnection cable
The programme
The programme functions similarly to the one from yesterday. Here, too, various digital pins are switched on and off in sequence in an infinite
loop. In this case, the three colour components of the RGB LED are involved.
Additive colour mixing
RGB LEDs use the so-called additive colour mixing. The three light colours red, green and blue are added and give pure white at the end. A
colour printer, by contrast, uses the subtractive colour mixing. Each colour acts as a filter on a white page that removes (= subtracts) a portion
of the white reflected light. If one prints all three printer colours over one another, the result is black, which no longer reflects any light at all.
In the programme, through alternating switches on and off, the LED alternates constantly between having one colour component lit and having
two lit. The RGB LED thereby alternates back and forth between six different colours.
The programme 04rgb01 causes the LEDs to flash alternately.
The speed of the colour change is controlled through a variable z, which is set to a specific value at the beginning of the programme and then
applies for each colour change.
Variables in Snap4Arduino
Variables are small memory spaces in which one can mark a number or anything else during a programme. When the programme is ended,
this variable memory is automatically cleared again. Variables must first be set once in Snap4Arduino before one can use them.










