User manual
When you touch the clay contacts at Pin3 and Pin2, the left paddle Player1 should move. In addition, the messages Player1up and Player1down
are sent, which are evaluated by the same object and converted into upward or downward movements.
Evaluating clay contacts and moving paddle "Player1"
The Player2 paddle cannot access the same Arduino and thus simply receives the messages that the Player1 paddle sends when the clay
contacts at Pin1 and Pin0 are touched. The paddle moves upward or downward accordingly. When the green flag is clicked, it is moved to the
starting position and then waits for messages.
The movements of the paddle "Player2"
Day 23
Today on the Advent calendar
• RGB LED
Flashing Christmas lighting
Components: 1xbreadboard, 2xRGB LED, 6x220-ohm resistor (red-red-brown), 7xconnection cable, 2xinsulated jumper
Two RGB LEDs flash randomly.
The programme
The programme shows how little programming effort is needed in Snap4Arduino to make two RGB LEDs flash in random colours. The numbers
of the pins used for the LEDs are stored in a list. An infinite loop sets a random pin selected from the list to true and then another randomly
selected pin to false. So all possible colour combinations can arise.
The programme 23blink causes two
RGB LEDs to flash in bright colours.
Day 24
Today on the Advent calendar
• Piezo buzzer
The piezo buzzer contained on the Advent calendar today makes electrical oscillations audible. If one applies a pulsing direct voltage between
the two terminals of the buzzer, it starts to vibrate. Depending on the frequency, individual clicks or a continuous tone can be heard. The human
ear still hears frequencies of a few Hertz (vibrations per second) as individual tones; frequencies between around 20 Hertz and 16 kHertz are
perceived as continuous tone of varying pitches.
Installing BuzzerFirmata
Snap4Arduino does not support a piezo buzzer as standard because this is also not supported by the base software StandardFirmata on the
Arduino. In order to generate tones with the piezo buzzer from Snap4Arduino, we use our own version of the current StandardFirmata, which is
expanded by the functions from the Snap4Arduino Firmata library (github.com/mdcanham/Snap4Arduino-Firmata).
The installation runs similarly to the standard installation of the Arduino described on the first day:
1 First quit Snap4Arduino and start the Arduino IDE.
2 Go to File/Open and load the file
BuzzerFirmata25.ino from the Downloads for the Advent Calendar in the Arduino IDE.
3 Click on the Upload icon in the top toolbar – this is the round symbol with the arrow pointing to the right. The software is then compiled and
transferred to the connected Arduino.










