pwm con touchpad
Dependencies: TSI TextLCD3 mbed
Revision 0:6dadccd599a2, committed 2013-12-12
- Comitter:
- caaruizze
- Date:
- Thu Dec 12 02:45:54 2013 +0000
- Commit message:
- pwm con touchpad;
Changed in this revision
diff -r 000000000000 -r 6dadccd599a2 TSI.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TSI.lib Thu Dec 12 02:45:54 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/vsluiter/code/TSI/#4dc2f5a3a731
diff -r 000000000000 -r 6dadccd599a2 TextLCD.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TextLCD.lib Thu Dec 12 02:45:54 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/caaruizze/code/TextLCD3/#241eed84760a
diff -r 000000000000 -r 6dadccd599a2 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Dec 12 02:45:54 2013 +0000 @@ -0,0 +1,41 @@ +#include "mbed.h" +#include "TSISensor.h" +#include "TextLCD.h" + +PwmOut led(LED1); +PwmOut led2(PTA5); + +TextLCD lcd(PTB10,PTB11,PTE2,PTE3,PTE4,PTE5); + +float a = 0.0; +float l; +int main() { +led.period(0.02); +led2.period(0.02); + +TSISensor tsi; + +float b = 0.0; + + while(1) { + a = tsi.readPercentage(); + if (tsi.readPercentage()){ + l = a; + } + + b = 0.001 + (l);// ancho de pulso + + + // servo position determined by a pulsewidth between 1-2ms + + led = 1.0 - l; + led2 = 1.0 - l; + lcd.locate(0,0); //localizar en la columna, fila de la LCD + lcd.printf("med:%0.3f", a); + lcd.locate(9,0); //localizar en la columna, fila de la LCD + lcd.printf("p(ms):%d", 20); + lcd.locate(0,1); //localizar en la columna, fila de la LCD + lcd.printf("D:%0.3f", b); + wait(0.25); + } +}
diff -r 000000000000 -r 6dadccd599a2 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Dec 12 02:45:54 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f \ No newline at end of file