asdsdsdsfasf

Dependencies:   mbed

Fork of PwmOut_HelloWorld by Mbed

main.cpp

Committer:
masterhorror
Date:
2015-03-19
Revision:
2:32f6e0cd5d6f
Parent:
1:5160ea45399b
Child:
3:80d90939a6cd

File content as of revision 2:32f6e0cd5d6f:

#include "mbed.h"

PwmOut led(LED1);

int main() {
    // specify period first
    led.period(0.002f);      // 4 second period
    led.write(led+0.01f); 
    led=led+0.01     // 50% duty cycle, relative to period
    //led = 0.5f;          // shorthand for led.write()
    //led.pulsewidth(2);   // alternative to led.write, set duty cycle time in seconds
    while(1);
}