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:92dd04f0bd52, 2013-05-01 (annotated)
- Committer:
- foxu2798
- Date:
- Wed May 01 10:48:56 2013 +0000
- Revision:
- 1:92dd04f0bd52
- Parent:
- 0:d5854f722e00
- Child:
- 2:e4df70a29bb0
I sent you a hi ya
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| zenglingxuan | 0:d5854f722e00 | 1 | #include "mbed.h" |
| zenglingxuan | 0:d5854f722e00 | 2 | |
| foxu2798 | 1:92dd04f0bd52 | 3 | //hi ya// |
| foxu2798 | 1:92dd04f0bd52 | 4 | |
| zenglingxuan | 0:d5854f722e00 | 5 | DigitalOut myled(LED1); |
| zenglingxuan | 0:d5854f722e00 | 6 | AnalogIn dis(PTB0); |
| zenglingxuan | 0:d5854f722e00 | 7 | |
| zenglingxuan | 0:d5854f722e00 | 8 | int main() { |
| zenglingxuan | 0:d5854f722e00 | 9 | while(1) { |
| zenglingxuan | 0:d5854f722e00 | 10 | int per; |
| zenglingxuan | 0:d5854f722e00 | 11 | per=dis*512/3.3; |
| zenglingxuan | 0:d5854f722e00 | 12 | if (per<7){ |
| zenglingxuan | 0:d5854f722e00 | 13 | myled=0; |
| zenglingxuan | 0:d5854f722e00 | 14 | } |
| zenglingxuan | 0:d5854f722e00 | 15 | else { |
| zenglingxuan | 0:d5854f722e00 | 16 | myled=1; |
| zenglingxuan | 0:d5854f722e00 | 17 | } |
| zenglingxuan | 0:d5854f722e00 | 18 | } |
| zenglingxuan | 0:d5854f722e00 | 19 | } |