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@9:32e85f1fcd15, 2014-07-16 (annotated)
- Committer:
 - sam_grove
 - Date:
 - Wed Jul 16 09:49:22 2014 +0000
 - Revision:
 - 9:32e85f1fcd15
 - Parent:
 - 6:a80519d6fdda
 - Child:
 - 10:ae5f62a1e40e
 
Update example to toggle faster and move object declarations to global scope
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| chris | 0:0024ab6b9624 | 1 | #include "mbed.h" | 
| chris | 0:0024ab6b9624 | 2 | |
| sam_grove | 9:32e85f1fcd15 | 3 | DigitalOut gpo(D0); | 
| sam_grove | 9:32e85f1fcd15 | 4 | DigitalOut led(LED_RED); | 
| chris | 0:0024ab6b9624 | 5 | |
| sam_grove | 9:32e85f1fcd15 | 6 | int main() | 
| sam_grove | 9:32e85f1fcd15 | 7 | { | 
| emilmont | 2:f37d74a0e3e2 | 8 | while (true) { | 
| sam_grove | 9:32e85f1fcd15 | 9 | gpo = !gpo; // toggle pin | 
| sam_grove | 9:32e85f1fcd15 | 10 | led = !led; // toggle led | 
| sam_grove | 9:32e85f1fcd15 | 11 | wait(0.2f); | 
| chris | 0:0024ab6b9624 | 12 | } | 
| chris | 0:0024ab6b9624 | 13 | } |