mbed-os
Fork of mbed-os by
features/unsupported/tests/mbed/tsi/main.cpp@1:3deb71413561, 2017-07-20 (annotated)
- Committer:
- xuaner
- Date:
- Thu Jul 20 14:26:57 2017 +0000
- Revision:
- 1:3deb71413561
- Parent:
- 0:f269e3021894
mbed_os
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
elessair | 0:f269e3021894 | 1 | #include "mbed.h" |
elessair | 0:f269e3021894 | 2 | #include "TSISensor.h" |
elessair | 0:f269e3021894 | 3 | |
elessair | 0:f269e3021894 | 4 | int main(void) { |
elessair | 0:f269e3021894 | 5 | DigitalOut led(LED_GREEN); |
elessair | 0:f269e3021894 | 6 | TSISensor tsi; |
elessair | 0:f269e3021894 | 7 | |
elessair | 0:f269e3021894 | 8 | while (true) { |
elessair | 0:f269e3021894 | 9 | printf("slider percentage: %f%\r\n", tsi.readPercentage()); |
elessair | 0:f269e3021894 | 10 | printf("slider distance: %dmm\r\n", tsi.readDistance()); |
elessair | 0:f269e3021894 | 11 | wait(1); |
elessair | 0:f269e3021894 | 12 | led = !led; |
elessair | 0:f269e3021894 | 13 | } |
elessair | 0:f269e3021894 | 14 | } |