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:acb8b16d7486, committed 2018-10-29
- Comitter:
- aldomarez
- Date:
- Mon Oct 29 18:31:11 2018 +0000
- Commit message:
- vfv
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 Mon Oct 29 18:31:11 2018 +0000 @@ -0,0 +1,21 @@ +/*Mediante un potenciómetro se varié el ancho de pulso para manejar la velocidad de un motor de CD +*/ +#include "mbed.h" +AnalogIn pot(A0); +PwmOut motor(D6); +/* +//El periodo por defecto es de 0.020s y el ancho de pulso 0 + led.period(4.0f);// 4 second period + led.write(0.50f);// 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 +*/ + +int main() { + while(1) { + float ancho = pot; + motor.write(ancho); + + } +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Oct 29 18:31:11 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/a7c7b631e539 \ No newline at end of file