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.
Dependencies: QEI TextLCD-modificada mbed
Fork of Tarea4 by
Diff: main.cpp
- Revision:
- 1:35c783e6bc3b
- Parent:
- 0:d7388a87aeb7
--- a/main.cpp Fri Nov 15 17:45:21 2013 +0000
+++ b/main.cpp Wed Apr 09 04:32:17 2014 +0000
@@ -9,7 +9,13 @@
DebouncedIn set(PTC17);
AnalogIn Vin(PTB0);
AnalogOut Vout(PTE30);
-
+PwmOut pw(PTA12);
+float Tdo=1/2093.005;
+float Pdo=Tdo/2;
+float Tre=1/2637.02;
+float Pre=Tre/2;
+float Tmi=1/3135.963;
+float Pmi=Tmi/2;
Timer t;
int flag;
int q;
@@ -125,11 +131,19 @@
cont=0;
while(1){
if(k>=3 && salto.falling()){
- k=0;
+ k=0;
+ pw.period(Tdo);
+ pw.pulsewidth(Pdo);
+ wait(0.1);
+ pw=0;
def_posicion(k);
}
if(salto.falling()){
++k;
+ pw.period(Tdo);
+ pw.pulsewidth(Pdo);
+ wait(0.1);
+ pw=0;
def_posicion(k);
}
else if(set.falling()){
