ใช้้สื่อสารระหว่างบอร์ด Brain และ Motion
Dependencies: BEAR_Protocol iSerial mbed
Revision 1:65ef1fe8e2f8, committed 2016-01-15
- Comitter:
- b0ssiz
- Date:
- Fri Jan 15 15:55:13 2016 +0000
- Parent:
- 0:db3b9f12e4d5
- Commit message:
- Update Floating point;
Changed in this revision
BEAR_Protocol.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r db3b9f12e4d5 -r 65ef1fe8e2f8 BEAR_Protocol.lib --- a/BEAR_Protocol.lib Wed Dec 23 13:09:30 2015 +0000 +++ b/BEAR_Protocol.lib Fri Jan 15 15:55:13 2016 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/teams/BEaR-lab/code/BEAR_Protocol/#2b18f3240c31 +https://developer.mbed.org/teams/BEaR-lab/code/BEAR_Protocol/#9fbe67ca2f1b
diff -r db3b9f12e4d5 -r 65ef1fe8e2f8 main.cpp --- 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); + }