test

Dependencies:   mbed XBee

Revision:
0:0322e37424fa
Child:
1:cb2c4d733c1b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jan 15 08:07:48 2021 +0000
@@ -0,0 +1,24 @@
+#include "mbed.h"
+#include "DRBlue_controller.h"
+
+DRBlue_controller Con(p28,p27,115200);
+Serial pc(USBTX,USBRX,115200);
+
+void con_timer()
+{
+    Con.update();
+}
+
+int main()
+{
+    Con.DRbegin();
+    while(1) {
+        double joyRX = Con.readJoyRXbyte();
+        double joyRY = Con.readJoyRYbyte();
+        double joyLX = Con.readJoyLXbyte();
+        double joyLY = Con.readJoyLYbyte();
+        pc.printf("%d\t",Con.getButtonState());
+        pc.printf("%3.0lf %3.0lf %3.0lf %3.0lf\n",joyRX,joyRY,joyLX,joyLY);
+        wait(0.05);
+    }
+}