Primera prueba...
Dependencies: SLCD Servo mbed tsi_sensor
Revision 0:6d8690fad6a1, committed 2015-01-03
- Comitter:
- juanjosecastillo
- Date:
- Sat Jan 03 03:53:02 2015 +0000
- Commit message:
- Falta...
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SLCD.lib Sat Jan 03 03:53:02 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/Sissors/code/SLCD/#ef2b3b7f1b01
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Servo.lib Sat Jan 03 03:53:02 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/simon/code/Servo/#36b69a7ced07
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Jan 03 03:53:02 2015 +0000 @@ -0,0 +1,61 @@ +#include "mbed.h" +#include "Servo.h" +#include "tsi_sensor.h" +#define LCDLEN 10 +#include "SLCD.h" + +/* This defines will be replaced by PinNames soon */ +#if defined (TARGET_KL25Z) || defined (TARGET_KL46Z) +#define ELEC0 9 +#define ELEC1 10 +#elif defined (TARGET_KL05Z) +#define ELEC0 9 +#define ELEC1 8 +#else +#error TARGET NOT DEFINED +#endif +TSIAnalogSlider tsi(ELEC0, ELEC1, 40); + +Servo s1(PTA13); +SLCD slcd; //define LCD display + + + + +int main() { + + float valor=0; + //char lcdData[LCDLEN]; + while(1) { + //s1.write(tsi.readPercentage()); + + + + //LCDMessNoDwell(); + //slcd.printf( "%f",tsi.readPercentage()); + + slcd.clear(); // All segments off + slcd.Home(); // sets next charater to posistion 0 (start) + //valor=tsi.readPercentage(); + PwmOut led(LED_GREEN); + valor=tsi.readPercentage(); + if (valor < 10) + { + //valor=0.5; + led = 1.0 - 0.5; + s1.write(0.5); + slcd.printf("%2.2f",0.5); + } + else + { + + led = 1.0 - valor; + s1.write(valor); + slcd.printf("%2.2f",valor); + + } + + + wait(0.1); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Jan 03 03:53:02 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/04dd9b1680ae \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsi_sensor.lib Sat Jan 03 03:53:02 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/Kojto/code/tsi_sensor/#20ffa9b18488