ใช้้สื่อสารระหว่างบอร์ด Brain และ Motion

Dependencies:   BEAR_Protocol iSerial mbed

Revision:
1:65ef1fe8e2f8
Parent:
0:db3b9f12e4d5
--- a/main.cpp	Wed Dec 23 13:09:30 2015 +0000
+++ b/main.cpp	Fri Jan 15 15:55:13 2016 +0000
@@ -1,10 +1,20 @@
 #include "mbed.h"
 #include "BEAR_Protocol.h"
+#include "math.h"
 #define baud 115200
 
 int main()
 {
-    float test;
+/*
+    float x=-4525.2345,y=10.1234;
     Bear_Communicate com(PA_15,PB_7,baud);
-    com.SetBodyLength(0x01,test);
+    com.setMotorPos(0x01,x,y);
+*/
+
+    float x=0,y=0;
+    Bear_Communicate com(PA_15,PB_7,baud);
+    com.getMotorPos(0x01,&x,&y);
+    printf("\nx=%f\n",x);
+    printf("y=%f\n",y);
+    
 }