MX28IDcheck
Diff: main.cpp
- Revision:
- 0:4d6b7e99b6fe
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 08 08:33:35 2015 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" +#include "MX28.h" + +Serial pc(USBTX,USBRX); /*パソコンとの通信*/ +MX28 mx28(p13,p14,57600); + +int main() { + pc.baud(57600); + + while(1){ + for(int ID=1;ID<=5;ID++){ + mx28.SetMovingSpeed(ID,0x0010); + mx28.SetGoalPosition(ID,0x00F0); + wait(0.5); + mx28.SetGoalPosition(ID,0x0FFF); + wait(0.5); + } + } +} \ No newline at end of file