Receive HID request LEONARDO

hello, i'm trying to receive HID request from a python script using hidapi.

My python program look like that

import hid
import time

vendor_id = 0x046D
product_id = 0xC092

device = hid.device()
device.open(vendor_id, product_id)

def send_data(x, y):
    data = [x, y]
    device.write([0] + data)

while True:
    key = input("Press 'P' to move or 'Q' to quit  ")
    if key.lower() == 'p':
        send_data(10, 10)
        time.sleep(0.1)  
    else:
        print("Press 'P' to move or 'Q' to quit  ")
        if key.lower() == 'q':
            break


device.close()

so i'm wondring, how to reveive the data on my arduino leonardo, i dont have USB host shield, and i'm not willing to use COM port, only hid request.

Any idea what to use ? such as library or stuff like that

Well, you need to receive the HID report from your device and decode it.

This might help

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.