Hello, have added some code which I found to work.
Best approach is to copy the code to a leafpad window, and save it to a file, say 'test.py'
Then, in a terminal window, run it by "python test.py".
If there are errors in console. mark them and copy paste here.
Code: Select all
import usb.core
import usb.util
dev = usb.core.find(idVendor=0x04d8, idProduct=0x005d)
print (dev)
if dev is None:
raise ValueError('Device not found')
else:
if dev.is_kernel_driver_active(0) is True:
# tell the kernel to detach
dev.detach_kernel_driver(0)
# claim the device
usb.util.claim_interface(dev, 0)
# most possibly this thing has only one configuration
# so no need to set it
# dev.set_configuration()
timeLSB = 100
timeMSB = 1
stepsLSB = 50
stepsMSB = 1
direction = 1
outputs = 0b00000110
data=[2, direction, timeLSB, timeMSB, stepsLSB, stepsMSB, outputs]
dev.write(2,data)