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.
You are viewing an older revision! See the latest version
Klasse PWM
Die folgende Klasse Rgb zeigt für eine Led die PWM am Beispiel RGB-LED des M0-Boards:
class Rgb {
PwmOut _red;
public:
Rgb( PinName red ) : _red(red) {}
void LedOn() {
//_red = 0;
for(float i=0.0; i <= 1.0; i+= 0.1) {
_red = i;
wait_ms(200);
}
}
void LedOff() {
_red = 1;
}
};
Rgb rgb(p36);