Arduino_Blink sample code ported.

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
homayoun
Date:
Wed Sep 03 10:25:31 2014 +0000
Commit message:
Arduino_Blink

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 516ad7c37471 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Sep 03 10:25:31 2014 +0000
@@ -0,0 +1,24 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1); // Instead of "pinMode(led, OUTPUT);" function, this creates an object called "myled", to be used later.
+
+// the setup routine runs once when you press reset:
+void setup()
+{
+
+}
+
+// the loop routine runs over and over again forever:
+void loop()
+{
+    myled = 1; // Instead of "digitalWrite(led, HIGH);"
+    wait(1.0); // Instead of "delay(1000);"
+    myled = 0; // Instead of "digitalWrite(led, LOW);"
+    wait(1.0); // Instead of "delay(1000);"
+}
+
+int main()
+{
+    setup();
+    while(1) loop();
+}
diff -r 000000000000 -r 516ad7c37471 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Sep 03 10:25:31 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013
\ No newline at end of file