Conveyor with Python - How to?


#1

Hello,

I have a dobot magician and I would like to use the conveyor belt with Python. However, there’s no example code of using the conveyor belt online. There is also no example code for the conveyer in the dobot demo.

I tried copying the code generated by Blockly and that didn’t work. Does anyone know how to use the conveyor with Python?

I’m using Python 3.6 (64 bit)


#2

I figured it out.

At first, I tried using the DobotDllType code from the Dobot Python examples. But the dll code seems to be broken. The command “SetEMotor” in the dll writes the conveyor speed to the serial port as a float but it needs to be an integer.

Don’t try to use the Dll files to talk to the Dobot. It’s not worth it. Use Pydobot instead https://github.com/luismesas/pydobot Pydobot does the same thing as the Dll files but it’s much easier to add your own code.


#3

change the EMotor to this:
class EMotor(cty.Structure):
pack = 1
fields = [
(“index”, cty.c_byte),
(“isEnabled”, cty.c_byte),
(“speed”, cty.c_int)
]