щл

Dependencies:   mbed

main.cpp

Committer:
Sasha_2004
Date:
2014-10-25
Revision:
0:c84e3b37c821

File content as of revision 0:c84e3b37c821:

#include "mbed.h"
 
PwmOut mypwm(D3);
 
DigitalOut myled(LED1);
 
int main() {
    
  
    while(1) {
        mypwm.period_ms(20);
        mypwm.pulsewidth_ms(1.00);
        printf("pwm set to %.2f %%\n", mypwm.read() * 100);
        myled = !myled;
        wait(1);
        mypwm.period_ms(20);
        mypwm.pulsewidth_ms(1.5);
        printf("pwm set to %.2f %%\n", mypwm.read() * 100);
        myled = !myled;
        wait(1);
        mypwm.period_ms(20);
        mypwm.pulsewidth_ms(2.05);
        printf("pwm set to %.2f %%\n", mypwm.read() * 100);
        myled = !myled;
        wait(1);
    }
}