TSI button support. You may custom the tsi channel of the button and button number.
Dependents: FRDM_KL25Z_TSI_Touch
Fork of TSI by
Diff: TSISensor.h
- Revision:
- 4:4b7c5856807e
- Parent:
- 2:507b1f67804b
--- a/TSISensor.h Thu May 09 09:24:34 2013 +0000 +++ b/TSISensor.h Thu May 21 16:29:40 2015 +0000 @@ -24,6 +24,46 @@ #ifndef TSISENSOR_H #define TSISENSOR_H +#define SLIDER_LENGTH 40 //LENGTH in mm +#define ELECTRODE_NUM 2 + +/*Chose the correct TSI channel for the electrode number*/ +#define ELECTRODE0 TSI_CH9 +#define ELECTRODE1 TSI_CH10 +#define ELECTRODE2 TSI_CH13 +#define ELECTRODE3 TSI_CH1 +#define ELECTRODE4 TSI_CH2 +#define ELECTRODE5 TSI_CH3 +#define ELECTRODE6 TSI_CH4 +#define ELECTRODE7 TSI_CH5 +#define ELECTRODE8 TSI_CH6 +#define ELECTRODE9 TSI_CH7 +#define ELECTRODE10 TSI_CH8 +#define ELECTRODE11 TSI_CH11 +#define ELECTRODE12 TSI_CH12 +#define ELECTRODE13 TSI_CH0 +#define ELECTRODE14 TSI_CH14 +#define ELECTRODE15 TSI_CH15 + +// TSI Channel THRESHOLD +#define THRESHOLD0 100 +#define THRESHOLD1 100 +#define THRESHOLD2 100 +#define THRESHOLD3 100 +#define THRESHOLD4 100 +#define THRESHOLD5 100 +#define THRESHOLD6 100 +#define THRESHOLD7 100 +#define THRESHOLD8 100 +#define THRESHOLD9 100 +#define THRESHOLD10 100 +#define THRESHOLD11 100 +#define THRESHOLD12 100 +#define THRESHOLD13 100 +#define THRESHOLD14 100 +#define THRESHOLD15 100 + + /** * TSISensor example * @@ -63,6 +103,10 @@ */ uint8_t readDistance(); + uint8_t Pressed(uint8_t ch); + float readTSI(uint8_t ch); + uint16_t readTSI_u16(uint8_t ch); + private: void sliderRead(void); void selfCalibration(void);