Parallax Servo Controller (Serial Version) and Z-World OP7200
Chris Zeman
Posts: 3
We are currently attempting to control servos with a Z-World OP7200 controller and a Parallax Servo Controller (#28023) -Rev B.
The Serial I/O pin is connected to TXC on the OP7200, - to GND on the OP7200 and 5VDC Common, and + to 5VDC. We've tried using the code below, as well as 3 other variations, but cannot get the servos to move.
Any help or suggestions would be greatly appreciated.
Thanks,
Chris
The Serial I/O pin is connected to TXC on the OP7200, - to GND on the OP7200 and 5VDC Common, and + to 5VDC. We've tried using the code below, as well as 3 other variations, but cannot get the servos to move.
Any help or suggestions would be greatly appreciated.
Thanks,
Chris
#class auto #memmap xmem #define CINBUFSIZE 255 #define COUTBUFSIZE 255 void main () { auto char shoulder[noparse][[/noparse]64]; auto char elbow[noparse][[/noparse]64]; /*static const char string1[noparse][[/noparse]] = "!SC"; static const char hex_array[noparse][[/noparse]] = 0x0D; static const char dec_array1[noparse][[/noparse]] = 0; static const char dec_array2[noparse][[/noparse]] = 7; static const char dec_array3[noparse][[/noparse]] = 226; static const char dec_array4[noparse][[/noparse]] = 4; static const char dec_array5[noparse][[/noparse]] = 250;*/ static unsigned char cout [noparse][[/noparse]9]; static const char ra = 7; static const char ch = 0; static const char cposh = 0xE2; static const char cposl = 0x4; brdInit(); serCopen(2400); serCparity(PARAM_2STOP); serMode(0); serCwrFlush(); memset(shoulder,0x00,sizeof(shoulder)); memset(elbow,0x00,sizeof(elbow)); for(;;) { //costate //{ sprintf(cout,"!SC%c%c%c%c%c",ch,ra,cposl,cposh,0x0d); serCwrite(cout,strlen(cout)); serCclose(); //memcpy(shoulder,string1,strlen(string1)); //memset(shoulder, 0x00, sizeof(shoulder)); } /*costate { pw = 1050; memcpy(elbow,string2,strlen(string2)); serCputs(elbow); memset(elbow,0x00, sizeof(elbow)); waitfor (DelayMs(2500)); pw = 300; memcpy(elbow,string2,strlen(string2)); serCputs(elbow); memset(elbow,0x00, sizeof(elbow)); } }*/ }
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Thank you,
Chris