Contains the main execution of the clock uses headers to import functions

Dependencies:   RTC-DS1307 SPI_TFT_ILI9341 TFT_fonts mbed tsi_sensor

Fork of TFT_Mikroelectronika_IL9341_sketchpad by Oxford CWM Team

Committer:
Owenmatthewmcgowan
Date:
Fri May 26 09:37:06 2017 +0000
Revision:
49:243b5e826228
Parent:
31:3255668e6b08
merge;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mlin 10:9d9b3b9b28b8 1 #include "tsi_sensor.h"
mlin 10:9d9b3b9b28b8 2 #if defined (TARGET_KL25Z) || defined (TARGET_KL46Z)
mlin 11:1da15361a35b 3 #define ELEC0 9
mlin 11:1da15361a35b 4 #define ELEC1 10
mlin 10:9d9b3b9b28b8 5 #elif defined (TARGET_KL05Z)
mlin 11:1da15361a35b 6 #define ELEC0 9
mlin 11:1da15361a35b 7 #define ELEC1 8
mlin 10:9d9b3b9b28b8 8 #else
mlin 11:1da15361a35b 9 #error TARGET NOT DEFINED
mlin 10:9d9b3b9b28b8 10 #endif
mlin 10:9d9b3b9b28b8 11 float tsi_current, tsi_last = 0;
mlin 31:3255668e6b08 12 TSIAnalogSlider tsi(PTB16, PTB17, 40);
mlin 11:1da15361a35b 13 float tsi_d()
mlin 11:1da15361a35b 14 {
mlin 31:3255668e6b08 15 //wait(0.5);
mlin 10:9d9b3b9b28b8 16 tsi_current = tsi.readPercentage();
mlin 10:9d9b3b9b28b8 17 float delta = 0;
mlin 31:3255668e6b08 18
mlin 10:9d9b3b9b28b8 19 if (tsi_current != 0 && tsi_last != 0) delta = tsi_current - tsi_last;
mlin 10:9d9b3b9b28b8 20 else delta = 0;
mlin 10:9d9b3b9b28b8 21 tsi_last = tsi_current;
mlin 31:3255668e6b08 22 pc.printf("%f\n\r",tsi_current);
mlin 10:9d9b3b9b28b8 23 return delta;
mlin 10:9d9b3b9b28b8 24 }