takeshi yoshida / Mbed 2 deprecated 2016_lambdaController

Dependencies:   mbed

Dependents:  

Revision:
8:3c53e18e16e6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example.cpp	Thu Oct 27 08:56:42 2016 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+#include "LambdaController.h"
+
+int main(void)
+{
+    Serial pc(USBTX, USBRX);
+    pc.baud(9600);
+    
+    LambdaController con(D1, D0);
+    
+    con.initialize_axis();
+    
+    while(1)
+    {
+        if (con.get_error())
+        {
+            pc.printf("error : %d\r\n", con.get_error());
+        }
+        else
+        {
+            pc.printf("buttons : %x\r\n", con.get_all_switch());
+            pc.printf("1 : %d\r\n", con.get_switch(0));
+//            pc.printf("joystick0 : %f\r\n", con.get_axis(con.Stick0X));
+//            pc.printf("joystick1 : %f\r\n", con.get_axis(con.Stick0Y));
+//            pc.printf("joystick2 : %f\r\n", con.get_axis(con.Stick1X));
+//            pc.printf("joystick3 : %f\r\n", con.get_axis(con.Stick1Y));
+        }
+    }
+}
\ No newline at end of file