Edoardo Vignali / Mbed 2 deprecated fading_pwm_led2

Dependencies:   mbed

main.cpp

Committer:
Calamaro
Date:
2015-02-20
Revision:
2:073d39b53874
Parent:
0:4860a91fb495
Child:
3:f057c1dbef0a

File content as of revision 2:073d39b53874:

#include "mbed.h"

PwmOut mypwm(PA_5);
int pulse_per = 10;

int main() {

for(int i = 0, i < pulse_per, i++){
    mypwm.period_ms(pulse_per);
    mypwm.pulsewidth_ms(i);
  
    printf("pwm set to %.2f %%\n", mypwm.read() * 100);
    }

}