mbed_example
/
PwmOut_ex_1
Additional PwmOut example
Diff: main.cpp
- Revision:
- 0:07220dd760cc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Jan 19 14:22:09 2017 -0600 @@ -0,0 +1,10 @@ +#include "mbed.h" + +PwmOut led(LED2); + +int main() { + // specify period first, then everything else + led.period(4.0f); // 4 second period + led.write(0.50f); // 50% duty cycle + while(1); // led flashing +}