Juan Camilo Peña
/
Lab01_pwm_
PWM Intervalo 10us hasta 180º
Revision 0:f7e145caa35a, committed 2018-02-15
- Comitter:
- JuanCamilo93
- Date:
- Thu Feb 15 02:24:55 2018 +0000
- Commit message:
- PWM-intervalos 10us hasta 180?
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Feb 15 02:24:55 2018 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" + +PwmOut mypwm(PA_10); + +DigitalOut myled(LED1); + +int main() { + + int Pos=1000; + + while(Pos<=2000){ + + mypwm.period_ms(20); + mypwm.pulsewidth_us(Pos); + wait(1); + Pos+=100; + + } + while(1) { + myled = !myled; + wait(1); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Feb 15 02:24:55 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/7130f322cb7e \ No newline at end of file