![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
FRDM_slide2fade
Fork of FRDM_TSI by
Diff: main.cpp
- Revision:
- 1:51b1b688179a
- Parent:
- 0:0f00f07ebde0
- Child:
- 6:06e5f77ba66e
diff -r 0f00f07ebde0 -r 51b1b688179a main.cpp --- a/main.cpp Thu Oct 11 11:05:51 2012 +0000 +++ b/main.cpp Fri Oct 12 11:42:21 2012 +0000 @@ -1,14 +1,12 @@ #include "mbed.h" -#include "TSI_Sensor.h" +#include "TSISensor.h" int main(void) { - DigitalOut led(LED_GREEN); - TSI_Sensor tsi; + PwmOut led(LED_GREEN); + TSISensor tsi; while (true) { - printf("slider percentage: %d%\r\n", tsi.getPercentage()); - printf("slider distance: %dmm\r\n", tsi.getDistance()); - wait(1); - led = !led; + led = 1.0 - tsi.readPercentage(); + wait(0.1); } -} +} \ No newline at end of file