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@1:ecbb7b79f50a, 2011-10-18 (annotated)
- Committer:
- Nurbol
- Date:
- Tue Oct 18 14:44:56 2011 +0000
- Revision:
- 1:ecbb7b79f50a
- Parent:
- 0:abbaf99d08a4
- Child:
- 2:3cceb8854782
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Nurbol | 0:abbaf99d08a4 | 1 | #include "mbed.h" |
| Nurbol | 0:abbaf99d08a4 | 2 | |
| Nurbol | 0:abbaf99d08a4 | 3 | AnalogIn sensor(p20); |
| Nurbol | 0:abbaf99d08a4 | 4 | |
| Nurbol | 0:abbaf99d08a4 | 5 | int main() { |
| Nurbol | 0:abbaf99d08a4 | 6 | |
| Nurbol | 1:ecbb7b79f50a | 7 | //while(1) { |
| Nurbol | 0:abbaf99d08a4 | 8 | if(sensor > 1.5) { |
| Nurbol | 0:abbaf99d08a4 | 9 | printf("Too near! (%f)", sensor.read()); |
| Nurbol | 0:abbaf99d08a4 | 10 | } |
| Nurbol | 0:abbaf99d08a4 | 11 | else{ |
| Nurbol | 0:abbaf99d08a4 | 12 | printf("Error (%f)", sensor.read()); |
| Nurbol | 0:abbaf99d08a4 | 13 | |
| Nurbol | 0:abbaf99d08a4 | 14 | } |
| Nurbol | 1:ecbb7b79f50a | 15 | //} |
| Nurbol | 0:abbaf99d08a4 | 16 | } |
| Nurbol | 0:abbaf99d08a4 | 17 |