From: mohamed k. <eng...@ya...> - 2017-08-23 10:32:00
|
Dear all I am using ubuntu and I have a python code to move the motor but there is no any response.This is my script:#starizona id (0x10c4,0x82f4) import sys import time import usb.core import usb.util # find our device dev = usb.core.find(idVendor=0x10c4, idProduct=0x82f4) # was it found? if dev is None: raise ValueError('Device not found') #print dev # set the active configuration. With no arguments, the first # configuration will be the active one dev.set_configuration() # get an endpoint instance cfg = dev.get_active_configuration() intf = cfg[(0,0)] ep = usb.util.find_descriptor( intf, # match the first OUT endpoint custom_match = \ lambda e: \ usb.util.endpoint_direction(e.bEndpointAddress) == \ usb.util.ENDPOINT_OUT) assert ep is not None # write the data input=1 while input : # get keyboard input data = raw_input('Enter your command here:') if data == 'exit': #sys.close() input=0 else: #this is requested by my device) ep.write(data) time.sleep(5) I appreciate if any one can help me Yoursmohamed |