takeshi yoshida / Mbed 2 deprecated 2016_lambdaController

Dependencies:   mbed

Dependents:  

Files at this revision

API Documentation at this revision

Comitter:
gakuburu
Date:
Thu Oct 27 08:56:42 2016 +0000
Parent:
7:5b74ff881644
Commit message:
example

Changed in this revision

example.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
--- /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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Oct 27 08:56:42 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/25aea2a3f4e3
\ No newline at end of file