mbed_example
/
PwmOut_HelloWorld
PwmOut Hello World
Fork of PwmOut_HelloWorld by
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 00003 PwmOut led(LED1); 00004 00005 int main() { 00006 // specify period first 00007 led.period(4.0f); // 4 second period 00008 led.write(0.50f); // 50% duty cycle, relative to period 00009 //led = 0.5f; // shorthand for led.write() 00010 //led.pulsewidth(2); // alternative to led.write, set duty cycle time in seconds 00011 while(1); 00012 }
Generated on Tue Jul 12 2022 21:03:39 by 1.7.2