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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 9:32e85f1fcd15
- Parent:
- 6:a80519d6fdda
- Child:
- 10:ae5f62a1e40e
--- a/main.cpp Wed Apr 09 04:29:23 2014 +0000
+++ b/main.cpp Wed Jul 16 09:49:22 2014 +0000
@@ -1,15 +1,13 @@
#include "mbed.h"
-int main() {
- DigitalOut gpo(D0);
- DigitalOut led(LED_RED);
+DigitalOut gpo(D0);
+DigitalOut led(LED_RED);
+int main()
+{
while (true) {
- gpo = 1;
- led = 1; // off
- wait(2);
- gpo = 0;
- led = 0; // on
- wait(2);
+ gpo = !gpo; // toggle pin
+ led = !led; // toggle led
+ wait(0.2f);
}
}
\ No newline at end of file