You are reading a single comment by @stephaneAG and its replies. Click here to read the full conversation.
  • back :)

    a quick update on the subjetc: I just finished writing a USB HID GamePad module ( yaaaaaayyyyy! ^^ ), and I'll digg that RN42 thing as soon as can do.

    this being said, I now better grasp some stuff from the data provided:

    using the RN42 HID firmware & sending a 'raw' hid report is done as ( p7 of their manual at https://cdn.sparkfun.com/datasheets/Wireless/Bluetooth/RN-HID-User-Guide-v1.0r.pdf):

    // Serial points to either an RN42 or a flashed HC-05 with HID support
    //E.sendUSBHID([
    Serial.write(
        0xFD,                // indicates raw hid report
        0x06,                 // bLength
        0x01,                 // bDescriptorType - constant ( String assigned by USB )
        x1,                     // Byte0
        y1,                     // Byte1
        x2,                    // Byte2
        y2                      // Byte3
        btnState & 0xFF,             // Byte4
        (btnState>>8) & 0xFF, // Byte5
    );
    //]);
    
    

    to the contrary, USB HID ( & maybe Espruino's bluetooth HID )

    E.sendUSBHID([
        // 0xFD,                // indicates raw hid report
        //0x06,                 // bLength
        //0x01,                 // bDescriptorType - constant ( String assigned by USB )
        btnState & 0xFF,      // Byte0
        (btnState>>8) & 0xFF, // Byte1
        x1,                   // Byte2
        y1,                   // Byte3
        x2,                   // Byte4
        y2                   // Byte5
    ]);
    

    One good thing to do 'd be summarizing the REALLY interesting parts from their doc to gain a huge amount of scroll time & cie .. ;)

About

Avatar for stephaneAG @stephaneAG started