• I found a old post(http://forum.espruino.com/conversations/­325589/) with code to use the Pico as a gamepad using its HID functionality and as I'm looking to build some stuff for Sim racing where it would be excelent to be able to simulate a joystick/gamepad I tried to get it to work but with no success.

    If anyone can point me in a good directions or have ideas on how to integrate hardware divices in a analog way to games, I would be happy.

  • So you're specifically after analog inputs, rather than just buttons?

    Because for sim racing and just buttons you might be fine with USB Keyboard, which is handled by http://www.espruino.com/USB ?

    The gamepad module was never added to the standard Espruino module list, but you should still be able to reference it by URL:

    var gamepad = require('https://raw.githubusercontent.c­om/stephaneAG/usbHidDescriptors/master/e­spruino_ble_hid_gamepad.js');
    // debug easily using http://html5gamepad.com/ ;p
    gamepad.sendGamepadState(0b1111111111111­111, 127, 127, 127, 127);
    gamepad.sendGamepadState(0b1111111111111­111, -127, -127, -127, -127);

    What happens if you try something like that?

  • I got both mouse and keyboard to work not gamepad when I tried with the code you suggested.

    But will have another try and se of I can figure out what is wrong.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Anyone has example of getting Pico to work as a gamepad

Posted by Avatar for Fredrik @Fredrik