Following Java code creates a message I can write to an arduino serial port to control a robotic arm:
public static byte[] uArmMessage(short armRot, short armStr, short armHt, short handAng, boolean ctlData){
byte[] msg ={(byte)0xFF,(byte)0xAA,(byte)((armRot>>8) 0xFF),
(byte)(armRot&0xFF),(byte)((armStr>>8)&0xFF),
(byte)(armStr&0xFF),(byte)((armHt>>8)&0xFF),
(byte)(armHt&0xFF),(byte)((handAng>>8)&0xFF),
(byte)(handAng&0xFF),(byte)(ctlData ? 1 : 2)};
return msg;
}
I need help writing this function in python. If someone could explain to me how exactly i get the output from this function into an arduino I would also really appreciate it!
if it is any help I have a PDF that explains the Communication Protocol being used.
if this is not the place for this kind of question, could someone reefer me to somewhere more fitting?