BusInOut Hello World

Dependencies:   mbed

mbed 2 and mbed OS 5

This is an mbed 2 example. For an mbed-os example, please see:

Import programBusInOut_HelloWorld

BusInOut Hello World

Revision:
0:91a6f3d1b2f0
Child:
1:075e57eccf3a
diff -r 000000000000 -r 91a6f3d1b2f0 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Feb 12 11:26:02 2013 +0000
@@ -0,0 +1,14 @@
+#include "mbed.h"
+ 
+BusInOut pins(p5, p10, p7);
+ 
+int main() {
+    pins.output();
+    pins = 0x3;     
+    wait(1);
+    pins.input();
+    wait(1);
+    if(pins == 0x6) {
+        printf("Hello!\n");
+    }
+}
\ No newline at end of file