mbed_example
/
PwmOut_ex_2
Additional PwmOut example
Diff: main.cpp
- Revision:
- 0:248dfc85bbf9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Jan 19 14:22:30 2017 -0600 @@ -0,0 +1,11 @@ +#include "mbed.h" + +PwmOut led(LED2); + +int main() { + // specify period first, then everything else + led.period(4.0f); // 4 second period + led.pulsewidth(2); // 2 second pulse (on) + while(1); // led flashing +} +