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@3:ce199b093e2f, 2011-10-18 (annotated)
- Committer:
- Nurbol
- Date:
- Tue Oct 18 14:56:32 2011 +0000
- Revision:
- 3:ce199b093e2f
- Parent:
- 2:3cceb8854782
- Child:
- 4:a04fdb2379d6
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Nurbol | 3:ce199b093e2f | 1 | #include "mbed.h" |
| Nurbol | 3:ce199b093e2f | 2 | |
| Nurbol | 3:ce199b093e2f | 3 | AnalogIn sensor(p20); |
| Nurbol | 3:ce199b093e2f | 4 | DigitalOut led(LED1); |
| Nurbol | 3:ce199b093e2f | 5 | |
| Nurbol | 3:ce199b093e2f | 6 | int main() { |
| Nurbol | 3:ce199b093e2f | 7 | |
| Nurbol | 3:ce199b093e2f | 8 | while(1) { |
| Nurbol | 3:ce199b093e2f | 9 | sensor.read(); |
| Nurbol | 3:ce199b093e2f | 10 | |
| Nurbol | 3:ce199b093e2f | 11 | if(sensor > 1.5) { |
| Nurbol | 3:ce199b093e2f | 12 | led = !led; |
| Nurbol | 3:ce199b093e2f | 13 | wait(1); |
| Nurbol | 3:ce199b093e2f | 14 | } |
| Nurbol | 3:ce199b093e2f | 15 | else{ |
| Nurbol | 3:ce199b093e2f | 16 | led = !led; |
| Nurbol | 3:ce199b093e2f | 17 | wait(5); |
| Nurbol | 3:ce199b093e2f | 18 | |
| Nurbol | 3:ce199b093e2f | 19 | } |
| Nurbol | 3:ce199b093e2f | 20 | } |
| Nurbol | 3:ce199b093e2f | 21 | } |
| Nurbol | 3:ce199b093e2f | 22 |