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:7170e3ed7284, 2011-10-20 (annotated)
- Committer:
- chris
- Date:
- Thu Oct 20 11:36:11 2011 +0000
- Revision:
- 0:7170e3ed7284
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| chris | 0:7170e3ed7284 | 1 | #include "mbed.h" |
| chris | 0:7170e3ed7284 | 2 | |
| chris | 0:7170e3ed7284 | 3 | BusOut leds(LED1,LED2,LED3,LED4); |
| chris | 0:7170e3ed7284 | 4 | |
| chris | 0:7170e3ed7284 | 5 | Ticker wakeup; |
| chris | 0:7170e3ed7284 | 6 | |
| chris | 0:7170e3ed7284 | 7 | void dostuff() { |
| chris | 0:7170e3ed7284 | 8 | for (int i=0; i<5; i++) { |
| chris | 0:7170e3ed7284 | 9 | leds = 1 << i; |
| chris | 0:7170e3ed7284 | 10 | wait(0.25); |
| chris | 0:7170e3ed7284 | 11 | } |
| chris | 0:7170e3ed7284 | 12 | } |
| chris | 0:7170e3ed7284 | 13 | |
| chris | 0:7170e3ed7284 | 14 | int main () { |
| chris | 0:7170e3ed7284 | 15 | |
| chris | 0:7170e3ed7284 | 16 | wakeup.attach(NULL, 3.0); |
| chris | 0:7170e3ed7284 | 17 | |
| chris | 0:7170e3ed7284 | 18 | while (1) { |
| chris | 0:7170e3ed7284 | 19 | dostuff(); |
| chris | 0:7170e3ed7284 | 20 | sleep(); |
| chris | 0:7170e3ed7284 | 21 | } |
| chris | 0:7170e3ed7284 | 22 | |
| chris | 0:7170e3ed7284 | 23 | } |