Hi, I’m trying to control the stepper motors on the Dobot magician using serial commands to the Dobot. The code packs a struct and then sends this over serial to the Dobot. Until now, this has worked for all commands. However, I am unable to control the stepper motors. The communication works by packing the the command into a struct, and then serializing it.
This is how the params are packed:
struct.pack(’<BBf’, index, isEnabled, speed)
Note that I am using BBf as the formating, ie a 8 bit int for both index and is enabled, and a four byte float for the speed. Theis is the only code that is spesific to this command. Sending this command with id = 135, r/w = 1 and isQueued = 0 or 1 produces no results.
The resulting hex data sent to the dobot with speed set to 10.000 is: As far as I can see, this should be the correct value to enable stepper motor 1 with speed = 10000.
aa:aa:08:87:03:00:01:00:40:1c:46:d3
What is wrong with the command, or is there something I am not seeing as to the resulting output of the command? How, in hex, should a command to enable the steppermotor look?