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
PWM Klasse
Siehe https://developer.mbed.org/users/mbed_official/code/mbed/docs/tip/classmbed_1_1PwmOut.html
Die Periodendauer (period) und die Pulsweite (puls width) kann sowohl in Sekunden, Milli-/Mikrosekunden als auch in Prozente der Periodendauer angegeben werden (siehe Tabelle). Die Default Periodendauer ist 20ms, und die Default-Pulsweite ist 0.
PwmOut myled(p6);
:
myled = 0.25f;
PwmOut & operator= (float value) A operator shorthand for write()
verwendet den PwmOut operator= als Abkürzung für led.write(0.25), was den duty cycle in Prozent als float angibt. D.h. der duty cycle ist 25%, die high-time pulse width ist 1/4 der Periode. Das gleiche bewirkt: