User manual

60
The second loop is starting now, for reasons of clarity it will count in an ascending order this time. The
corresponding values for the duty cycle of each iteration are calculated for the first LED from the PWM object
which in this cycle is dimmed step by step. The duty cycle for the second LED is simply incremented again
by the PWM object
q. The blinking effect is caused by the modified frequency.
q.ChangeFrequency(50) At the end of the second loop, the frequency of this LED is reset to 50 Hertz, so
that in the next cycle it slowly intensifies in brightness just like the first LED.
7 Indicator with LEDs for free space on the memory card
Memory cards as hard drives are always full far too quickly. What is needed is a simple optical status
indicator, so that you can always see at a glance when space on the memory is running low. This can be
perfectly implemented on the Raspberry Pi using three LEDs. Functions of the operating system are used
here, which are queried via Python.
Fig. 7.1: Of course, it is also possible to show the free memory space directly in the File Manager on the Raspberry Pi.
We will take the three LEDs which we used for the traffic lights circuit which can feature different color
combinations for indicating the free space on the memory card.