User manual

the spots in pairs to display even numbers.
In the circuit, both side rails of the breadboard are used for earth lines. Therefore, the clay contact is connected somewhat differently this time.
How are random numbers generated?
It is commonly thought that nothing can be random in a programme – so how can a programme be in a position to generate random
numbers? If one divides a large prime number by any value, the result after the x-th decimal place are numbers that are practically impossible
to predict. These also change without any regularity when one increases the divisor regularly. This result does indeed appear to be random,
but it can be reproduced at any time by an identical programme or by calling up the same programme multiple times. However, if one takes a
number made up of some of these digits and divides it again by a number given by the current seconds or the content of any desired memory
cell of the computer, an answer results that cannot be reproduced and can thus be considered a random number.
The programme
When the user clicks on the green flag, an infinite loop starts that constantly checks whether the clay contact is being touched. If this is the case,
the four pins used for LEDs are first switched off to delete the previously displayed roll of the die.
Then a random number between 1 and 6 is stored in the variable w. For each possible result, there is a separate if… block that switches on the
corresponding LEDs.
The programme 12wuerfel01 simulates a six-sided gaming die.
Day 13
Today on the Advent calendar
220-ohm resistor (red-red-brown)
This resistor will not be needed until the next few days.
LED dice with realistic rolling effect
Components: 1xbreadboard, 2xred LED, 2x yellow LED, 2x green LED, 1x blue LED, 7x220-ohm resistor (red-red-brown), 1x20-Mohm resistor
(red-black-blue), 7xconnection cable, 5x insulated jumper (varying lengths), 2xclay contact
An actual die does not immediately show the final number of spots; rather, it first rolls for a short time in which one sees results that do not then
prove true. The program of Day 13 simulates the rolling in which the die first shows a few other results with minimal but ever increasing pauses
between them before the final result appears.
The programme
The programme uses the same rolling routine but does not roll only once after the clay contact is touched; rather, it rolls four times in a row,
whereby the wait times increase each time by 0.2 seconds before the result is deleted.
The programme 13wuerfel02 rolls with realistic rolling effect.
Day 14
Today on the Advent calendar
15-kohm potentiometer
Dimming LED with potentiometer
Required components: 1xbreadboard, 1xyellow LED, 1x220-ohm resistor, 1x15-kohm potentiometer, 4xconnection cable, 1xinsulated
jumper
LED dimmer with potentiometer
To truly dim an LED like a living room lamp, we use the potentiometer from the Advent calendar for today. With this adjustable resistor, one can