Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
PWM RGB
PWM-Programmierung der RGB-Leds
Die RGB-Leds sind auf PWM-fähigen Ports angeschlossen und haben folgende Zuordnung:
- Grün: P0_9 = p5
- Blau: P1_15 = p34
- Rot: P0_21 = p36
Definition im Programm:
PwmOut green(p5); PwmOut blue(p34); PwmOut red(p36); : green.period(0.001); // Periodendauer für Grün ist 1ms blue = red = 1; // Leds ausschalten
Die Übergabe an die PWM-Einheit erfolgt über eine float-Variable (0.0 bis 1.0), wobei die Zuordnung über 1=LED off und 0 =LED 100% hell definiert ist.