TSI read values are now sent to the serial port. Red LED part of the RGB will light up with an intensity that depends on the TSI read value.
Fork of FRDM_TSI by
Diff: main.cpp
- Revision:
- 0:0f00f07ebde0
- Child:
- 1:51b1b688179a
diff -r 000000000000 -r 0f00f07ebde0 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 11 11:05:51 2012 +0000 @@ -0,0 +1,14 @@ +#include "mbed.h" +#include "TSI_Sensor.h" + +int main(void) { + DigitalOut led(LED_GREEN); + TSI_Sensor tsi; + + while (true) { + printf("slider percentage: %d%\r\n", tsi.getPercentage()); + printf("slider distance: %dmm\r\n", tsi.getDistance()); + wait(1); + led = !led; + } +}