Benjamin Brou
/
Test_Capteur
dgfn
Diff: lib.h
- Revision:
- 0:84a89cfeff98
diff -r 000000000000 -r 84a89cfeff98 lib.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib.h Sat Dec 14 09:09:30 2019 +0000 @@ -0,0 +1,16 @@ +/* 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); +float lire_slider() +{ + return (1-tsi.readPercentage()); +} \ No newline at end of file