Instructions

The program
12fussgaengerrot
controls
a pedestrian traffic light with RGB-LED
13. Day
RGB flash effects
The experiment of the 13th day makes two RGB LEDs flash alternatingly. The colours can be switched on interactively on the screen.
Components: 1 x plug board, 2 x RGB LED, 6 x 220-Ohm resistor, 1 x wire bridge (connection wide), 7 x connection cables
The program
The program shows another method for setting output pins in ScratchGPIO. It uses three variables, one per colour. The variables
r
,
g
and
b
are
displayed with controllers on the stage. Here, the user can switch the three colour components on and off interactively. Additionally, there are
six variables for the pins used for the two RGB-LEDs. They are set to the corresponding values.
In an endless loop, the three GPIO-pins
11
,
12
and
13
of the first RGB-LED are set to the specified colour values, and the three GPIO-pins
16
,
18
and
15
of the second RGB-LED are switched off. After a brief waiting time, the first RGB-LED is switched off and the second one is given the set
colour values. Alternatingly switching the LEDs will lead to an alternating flash.