Still Test

Dependencies:   DXL_SDK_For_F446RE RobotControl_7Axis Matrix mbed

Committer:
stanley1228
Date:
Tue Feb 07 09:50:51 2017 +0000
Revision:
2:fb9508744bc4
Parent:
0:1780ffc33286
Child:
3:8a9407817ba9
dxl_write_word(3,GOAL_POSITION,400); //Testok; setPosition(3,2048,10);//Testok

Who changed what in which revision?

UserRevisionLine numberNew contents of line
stanley1228 0:1780ffc33286 1 #include "mbed.h"
stanley1228 0:1780ffc33286 2 #include "dynamixel.h"
stanley1228 0:1780ffc33286 3
stanley1228 0:1780ffc33286 4 #define ADDRESS_LED 0x19
stanley1228 2:fb9508744bc4 5 #define GOAL_POSITION 30
stanley1228 0:1780ffc33286 6
stanley1228 0:1780ffc33286 7 DigitalOut myled(LED1);
stanley1228 0:1780ffc33286 8 Serial pc(SERIAL_TX, SERIAL_RX);
stanley1228 0:1780ffc33286 9
stanley1228 0:1780ffc33286 10
stanley1228 0:1780ffc33286 11 int main()
stanley1228 0:1780ffc33286 12 {
stanley1228 0:1780ffc33286 13 int rt =0;
stanley1228 0:1780ffc33286 14
stanley1228 0:1780ffc33286 15 pc.printf("start\n",rt);
stanley1228 0:1780ffc33286 16
stanley1228 0:1780ffc33286 17 rt=dxl_initialize( 1, 1);
stanley1228 0:1780ffc33286 18 pc.printf("dxl_initialize rt=%d\n",rt);
stanley1228 0:1780ffc33286 19
stanley1228 0:1780ffc33286 20 myled = 0; // LED is ON
stanley1228 0:1780ffc33286 21
stanley1228 0:1780ffc33286 22 /**************************
stanley1228 0:1780ffc33286 23 *** Check communication ***
stanley1228 0:1780ffc33286 24 **************************/
stanley1228 2:fb9508744bc4 25 //dxl_write_byte(3,ADDRESS_LED,0);
stanley1228 0:1780ffc33286 26 //dxl_ping(3);
stanley1228 0:1780ffc33286 27
stanley1228 2:fb9508744bc4 28
stanley1228 0:1780ffc33286 29 while(1)
stanley1228 0:1780ffc33286 30 {
stanley1228 2:fb9508744bc4 31
stanley1228 2:fb9508744bc4 32 pc.printf("before=%d\n",rt);
stanley1228 2:fb9508744bc4 33
stanley1228 2:fb9508744bc4 34 //dxl_write_word(3,GOAL_POSITION,400);
stanley1228 2:fb9508744bc4 35 setPosition(3,2048,10);
stanley1228 2:fb9508744bc4 36 pc.printf("after=%d\n",rt);
stanley1228 0:1780ffc33286 37 //myled = 1; // LED is ON
stanley1228 2:fb9508744bc4 38 wait(4);
stanley1228 2:fb9508744bc4 39 //dxl_write_word(3,GOAL_POSITION,-400);
stanley1228 2:fb9508744bc4 40 setPosition(3,-2048,10);
stanley1228 0:1780ffc33286 41 //myled = 0; // LED is ON
stanley1228 2:fb9508744bc4 42 wait(4);
stanley1228 2:fb9508744bc4 43
stanley1228 0:1780ffc33286 44 }
stanley1228 0:1780ffc33286 45 }