KurtE
Senior Member+
Might help to see how they were copy and pasted....
I would assume you added it to ax12Serial.h like:
The actual code would go into ax12serial.cpp like:
FYI - I ordered two of these servos from Robotis USA, which hopefully they will ship soon...
I would assume you added it to ax12Serial.h like:
Code:
void ax12SetRegister4(int id, int regstart, int data);
The actual code would go into ax12serial.cpp like:
Code:
/* Set the value of a double-byte register. */
void ax12SetRegister4(int id, int regstart, int data){
setTX(id);
uint32_t udata = (uint32_t)data; // maybe not needed, but remove sign extension stuff...
int checksum = ~((id + 7 + AX_WRITE_DATA + regstart + (udata&0xFF)
+ ((udata>>16) & 0xff) + ((udata>>24) & 0xff)) % 256);
ax12writeB(0xFF);
ax12writeB(0xFF);
ax12writeB(id);
ax12writeB(7); // length
ax12writeB(AX_WRITE_DATA);
ax12writeB(regstart);
ax12writeB(udata&0xff);
ax12writeB((udata>>8)&0xff);
ax12writeB((udata>>16)&0xff);
ax12writeB((udata>>24)&0xff);
ax12writeB(checksum);
setRX(id);
//ax12ReadPacket();
}
FYI - I ordered two of these servos from Robotis USA, which hopefully they will ship soon...