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.
Fork of DigitalOut_HelloWorld by
Diff: main.cpp
- Revision:
- 3:29debdbea629
- Parent:
- 2:b4e2eee99a28
- Child:
- 4:340f9fb00d71
diff -r b4e2eee99a28 -r 29debdbea629 main.cpp
--- a/main.cpp Sat Sep 20 21:47:16 2014 +0000
+++ b/main.cpp Fri Mar 27 18:59:59 2015 +0000
@@ -3,10 +3,15 @@
DigitalOut myled(LED1);
int main() {
+ int connected = myled.is_connected(); // check that myled object is initialized and connected to a pin
+ printf("myleD connection stattus = %d", connected);
while(1) {
- myled = 1; // turn myled on
- wait(0.2);
- myled = 0; // turn myled off
- wait(0.2);
+ myled = 1; // set LED1 pin to high
+ printf("\n\r myled = %d",myled);
+ wait(0.5);
+
+ myled.write(0); // set LED1 pin to low
+ printf("\n\r myled = %d",myled.read() );
+ wait(0.5);
}
}
