I'm connecting to 2 identical microphone arrays using the pyusb library, but they have the same idVendor and idProduct numbers. The only way to differentiate the 2 devices is by address, but I'm unable to figure out how to connect using address.
Is there any way to make a usb connection using a device's address instead of idVendor or idProduct?
Here is the code
import usb.core
import usb.util
import time
from tuning import Tuning
import dfu
device_list = dfu.DFU.find()
print(device_list)
dev1 = usb.core.find(idVendor=0x2886, idProduct=0x0018) #address = 0x013
dev2 = usb.core.find(idVendor=0x2886, idProduct=0x0018) #address = 0x012
if dev1:
Mic_tuning1 = Tuning(dev1)
Mic_tuning2 = Tuning(dev2)
print(Mic_tuning1.direction)
print(Mic_tuning2.direction)
while True:
try:
print(Mic_tuning1.direction)
print(Mic_tuning2.direction)
time.sleep(1)
except KeyboardInterrupt:
break
else: print('failed to find microphone')