Controlling keyboard LEDs with USB Host Shield I've got a USB keyboard connected to my Arduino Uno with a USB Host Shield. I'm reading keystrokes using this example from the USB Host Shield library.

I need to toggle the LEDs in the keyboard (that indicate the state of Caps Lock, Num Lock etc.)

This thread mentions using Usb.setReport(), but this method doesn't seem to exist any more: there's no such method in Usb.cpp in the library. There does seem to be a method called SetReport in the USBHID class, which looks like it takes the same arguments, which I'm trying to use.

What I'm currently doing:

void keyboard_setup(){
    static HIDBoot&lt;USB_HID_PROTOCOL_KEYBOARD&gt; HidKeyboard(&amp;Usb);
    if (Usb.Init() == -1) {
        Serial.println("OSC did not start.");
    }
    delay(200);
    HidKeyboard.SetReportParser(0, &amp;Prs);

    static USBHID usbhid(&amp;Usb);
    uint8_t leds = 1;
#define KBD_ADDR 1
#define KBD_IF 0
    usbhid.SetReport( KBD_ADDR, 0, 1, KBD_IF, 0, &amp;leds );
    delay(100);
    leds = 255;
    usbhid.SetReport( KBD_ADDR, 0, 1, KBD_IF, 0, &amp;leds );
    delay(100);


Neither call to SetReport seems to work, and I'm not certain the values of KBD_ADDR or KBD_IF are correct (I'm using ones that I've seen in examples), or event that calling SetReport is right .

What am I doing wrong?
There does seem to be a method called SetReport in the USBHID class, which looks like it takes the same arguments, which I'm trying to use.

The method arguments of the new SetReport() method aren't quite the same and some are in a different order.
The old method signature was:
uint8_t setReport( uint8_t addr, uint8_t ep, unsigned int nbytes, uint8_t interface, uint8_t report_type, uint8_t report_id, uint8_t* dataptr );

...while the new one is:
uint8_t SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t* dataptr);

It seems to me the equivalent call would be:
usbhid.SetReport( 0, KBD_IF, 0x02, 0, 1, &amp;leds );