UT CS Bootcamp code for creating a secret knock
Dependencies: MMA8451Q mbed tsi_sensor
Fork of UTCSBootcamp by
Diff: main.cpp
- Revision:
- 11:0ac08d8a296f
- Parent:
- 10:351ba1920e42
--- a/main.cpp Thu Aug 21 19:48:43 2014 +0000 +++ b/main.cpp Fri Aug 22 19:52:08 2014 +0000 @@ -1,11 +1,23 @@ #include "mbed.h" // mbed +//#include <stdarg.h> #include <MMA8451Q.h> // accelerometer #include <stdlib.h> // abs #include <math.h> // sqrt #include "KnockAPI.h" // our api -int main() { - init(); /// call the base inits +#define ELEC0 9 +#define ELEC1 10 +/** Get the TouchSensor object + Code for the touch sensor can be found in tsi_sensor.h + important functions + readPercentage(); //returns where the "touch" is, + the touch is a value between [0 ... 1] + 0 represents no touch, greater than 0 to 1 from left to right + */ +TSIAnalogSlider ts(ELEC0, ELEC1, 40); + +int main(void) { + init(); /// call the base inits /* uncomment to see print traces from all API functions (you will need to use your serial port for this) */ // setDebug(true); @@ -24,4 +36,4 @@ } finish(); /// call the base finish -} +} \ No newline at end of file