Forked TSI
Diff: TSISensor.h
- Revision:
- 2:507b1f67804b
- Parent:
- 1:4dd9262cac47
- Child:
- 3:1ce79215bbe4
diff -r 4dd9262cac47 -r 507b1f67804b TSISensor.h --- a/TSISensor.h Thu Oct 11 14:00:48 2012 +0000 +++ b/TSISensor.h Fri Oct 12 11:42:12 2012 +0000 @@ -30,17 +30,15 @@ * @code * #include "mbed.h" * #include "TSISensor.h" -* +* * int main(void) { -* DigitalOut led(LED_GREEN); -* TSISensor tsi; -* -* while (true) { -* printf("slider percentage: %f%\r\n", tsi.readPercentage()); -* printf("slider distance: %dmm\r\n", tsi.readDistance()); -* wait(1); -* led = !led; -* } +* PwmOut led(LED_GREEN); +* TSISensor tsi; +* +* while (true) { +* led = 1.0 - tsi.readPercentage(); +* wait(0.1); +* } * } * @endcode */