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:ff8004800027, 2014-07-23 (annotated)
- Committer:
- hasimo
- Date:
- Wed Jul 23 10:39:58 2014 +0000
- Revision:
- 0:ff8004800027
?????????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hasimo | 0:ff8004800027 | 1 | #include "mbed.h" |
hasimo | 0:ff8004800027 | 2 | |
hasimo | 0:ff8004800027 | 3 | Timeout timeout; |
hasimo | 0:ff8004800027 | 4 | DigitalOut led(LED1); |
hasimo | 0:ff8004800027 | 5 | |
hasimo | 0:ff8004800027 | 6 | int on = 1; |
hasimo | 0:ff8004800027 | 7 | |
hasimo | 0:ff8004800027 | 8 | void attimeout(){ |
hasimo | 0:ff8004800027 | 9 | on = 0; |
hasimo | 0:ff8004800027 | 10 | } |
hasimo | 0:ff8004800027 | 11 | |
hasimo | 0:ff8004800027 | 12 | int main() { |
hasimo | 0:ff8004800027 | 13 | timeout.attach(&attimeout, 5); |
hasimo | 0:ff8004800027 | 14 | |
hasimo | 0:ff8004800027 | 15 | // spin in a main loop. flipper will interrupt it to call flip |
hasimo | 0:ff8004800027 | 16 | while(on) { |
hasimo | 0:ff8004800027 | 17 | led = !led; |
hasimo | 0:ff8004800027 | 18 | wait(0.2); |
hasimo | 0:ff8004800027 | 19 | } |
hasimo | 0:ff8004800027 | 20 | } |