Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp@0:0f00f07ebde0, 2012-10-11 (annotated)
- Committer:
- emilmont
- Date:
- Thu Oct 11 11:05:51 2012 +0000
- Revision:
- 0:0f00f07ebde0
- Child:
- 1:51b1b688179a
KL25Z TSI example
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| emilmont | 0:0f00f07ebde0 | 1 | #include "mbed.h" |
| emilmont | 0:0f00f07ebde0 | 2 | #include "TSI_Sensor.h" |
| emilmont | 0:0f00f07ebde0 | 3 | |
| emilmont | 0:0f00f07ebde0 | 4 | int main(void) { |
| emilmont | 0:0f00f07ebde0 | 5 | DigitalOut led(LED_GREEN); |
| emilmont | 0:0f00f07ebde0 | 6 | TSI_Sensor tsi; |
| emilmont | 0:0f00f07ebde0 | 7 | |
| emilmont | 0:0f00f07ebde0 | 8 | while (true) { |
| emilmont | 0:0f00f07ebde0 | 9 | printf("slider percentage: %d%\r\n", tsi.getPercentage()); |
| emilmont | 0:0f00f07ebde0 | 10 | printf("slider distance: %dmm\r\n", tsi.getDistance()); |
| emilmont | 0:0f00f07ebde0 | 11 | wait(1); |
| emilmont | 0:0f00f07ebde0 | 12 | led = !led; |
| emilmont | 0:0f00f07ebde0 | 13 | } |
| emilmont | 0:0f00f07ebde0 | 14 | } |