Other Parts Discussed in Thread: USB2ANY
Tool/software:
Hi,
I'm trying to write commands using python and windows, the goal is to load a few presets options and toggle between them while running other program.
I've used device.set_raw_data_handler(data_received) - and tried to write the device from TICS PRO software, logged the relevant data.
here's a part of my program, in this example the OUT0 should be off,
writing to address 0x07
data: 0x6501 to turn off
default data is 0x6503:
import pywinusb.hid as hid
# Vendor ID and Product ID of your device
VID = 0x2047
PID = 0x301
# I2C address of the device
I2C_ADDRESS = 0x69
REPORT_ID = 0x00
# Find the device
filter = hid.HidDeviceFilter(vendor_id=VID, product_id=PID)
devices = filter.get_devices()
if devices:
device = devices[0]
device.open()
device.set_raw_data_handler(data_received)
report = device.find_output_reports()
Toff = [63, 10, 84, 43, 2, 2, 0, 31, 0, 7, 101, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 128, 101, 3, 62, 150, 48, 255, 4, 240, 0, 0, 232, 0, 133, 202, 169, 93, 2, 53, 217, 94, 8, 220, 130, 15, 217, 43, 72, 59, 143, 158, 89, 144, 93, 124, 4, 27, 0, 0, 0, 16]
device.send_output_report(Toff)
I don't get any errors but the writing doesn't work. couldn't find any API of documentation to understand the command structure.
would appreciate your support to understand the structure or how to properly set command / load exported values from TICS PRO