alonso vallejo
/
lab9_TSI
fime
Revision 0:227a49f3c678, committed 2015-05-29
- Comitter:
- Alonso
- Date:
- Fri May 29 14:17:16 2015 +0000
- Commit message:
- lab9 para fime
Changed in this revision
diff -r 000000000000 -r 227a49f3c678 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri May 29 14:17:16 2015 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" +#include "tsi_sensor.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 + +int main(void) { + PwmOut led1(LED_GREEN); + PwmOut led2(LED_RED); + TSIAnalogSlider tsi(ELEC0, ELEC1, 40); + + while (true) + { + led1 = 1.0 - tsi.readPercentage(); + led2 = tsi.readPercentage(); + wait(0.1); + } +}
diff -r 000000000000 -r 227a49f3c678 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri May 29 14:17:16 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/dbbf35b96557 \ No newline at end of file
diff -r 000000000000 -r 227a49f3c678 tsi_sensor.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsi_sensor.lib Fri May 29 14:17:16 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/Kojto/code/tsi_sensor/#395a4619c41f