Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:5d0256c83f87, committed 2018-12-16
- Comitter:
- Otakutronics
- Date:
- Sun Dec 16 23:26:01 2018 +0000
- Commit message:
- PTA2 como salida PWM
Changed in this revision
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
pwm.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 5d0256c83f87 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Dec 16 23:26:01 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/04dd9b1680ae \ No newline at end of file
diff -r 000000000000 -r 5d0256c83f87 pwm.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pwm.cpp Sun Dec 16 23:26:01 2018 +0000 @@ -0,0 +1,20 @@ +#include "mbed.h" + +DigitalOut gpo(D0); +DigitalOut led(LED_BLUE,1); +PwmOut rojo(PTA2); +//>< +int main() +{ + float i; + rojo.period_ms(100); + while(1){ + for (i=1.0f;i>0.0f;i=i-0.0025f){ + rojo.write(i); + wait_ms(25); + } + } + // gpo = !gpo; // toggle pin + // led = !led; // toggle led + // wait(0.2f); +} \ No newline at end of file