![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Still Test
Dependencies: DXL_SDK_For_F446RE RobotControl_7Axis Matrix mbed
main.cpp
- Committer:
- stanley1228
- Date:
- 2017-02-08
- Revision:
- 3:8a9407817ba9
- Parent:
- 2:fb9508744bc4
- Child:
- 4:53ef39fbf9d9
File content as of revision 3:8a9407817ba9:
#include "mbed.h" #include "dynamixel.h" #define ADDRESS_LED 0x19 #define GOAL_POSITION 30 DigitalOut myled(LED1); Serial pc(SERIAL_TX, SERIAL_RX); int main() { int rt =0; pc.printf("start\n",rt); rt=dxl_initialize( 1, 1); pc.printf("dxl_initialize rt=%d\n",rt); int nnn=-100; pc.printf("nnn=%d\n",nnn); nnn=-1000; pc.printf("nnn=%d\n",nnn); myled = 0; // LED is ON /************************** *** Check communication *** **************************/ //dxl_write_byte(3,ADDRESS_LED,0); //dxl_ping(3); short int pos=0; //16bit while(1) { //pc.printf("before=%d\n",rt); //dxl_write_word(3,GOAL_POSITION,400); //setPosition(3,2048,10); //pc.printf("after=%d\n",rt); //myled = 1; // LED is ON //wait(4); //dxl_write_word(3,GOAL_POSITION,-400); //setPosition(3,-2048,10); //myled = 0; // LED is ON //wait(4); pos=dxl_read_word(3,PRESENT_POS); pc.printf("pos=%d\n",pos); wait_ms(200); } }