{"id":20853880,"url":"https://github.com/wolfeidau/esp32-hid-joystick","last_synced_at":"2025-10-16T08:02:31.988Z","repository":{"id":49064590,"uuid":"187924053","full_name":"wolfeidau/esp32-hid-joystick","owner":"wolfeidau","description":null,"archived":false,"fork":false,"pushed_at":"2019-10-05T02:08:23.000Z","size":102,"stargazers_count":93,"open_issues_count":4,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-14T22:49:24.319Z","etag":null,"topics":["bluetooth-low-energy","esp32","joystick"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wolfeidau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-21T22:44:00.000Z","updated_at":"2024-04-02T22:06:27.000Z","dependencies_parsed_at":"2022-08-12T20:00:39.658Z","dependency_job_id":null,"html_url":"https://github.com/wolfeidau/esp32-hid-joystick","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfeidau%2Fesp32-hid-joystick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfeidau%2Fesp32-hid-joystick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfeidau%2Fesp32-hid-joystick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfeidau%2Fesp32-hid-joystick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wolfeidau","download_url":"https://codeload.github.com/wolfeidau/esp32-hid-joystick/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225121484,"owners_count":17424087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bluetooth-low-energy","esp32","joystick"],"created_at":"2024-11-18T03:23:36.331Z","updated_at":"2025-10-16T08:02:31.898Z","avatar_url":"https://github.com/wolfeidau.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esp32-hid-joystick\n\nThis is a Bluetooth Low Energy (BLE) HID joystick I put together using a [WEMOS D32PRO](https://wiki.wemos.cc/products:d32:d32_pro) and an [Adafruit joystick](https://www.adafruit.com/product/512).\n\n# Why?\n\nThe aim of this project is build a functional, cheap and open Joystick/Gamepad device using off the shelf parts, which is battery powered and connects to any PC/Mac/Phone using BLE.\n\nThis project currently uses ESP32 micro controller because:\n\n1. It is cheap and widely available.\n2. It has an open source SDK which is based on FreeRTOS.\n3. Has great out of the box examples of BLE HID devices, which I used as the basis for this project. \n4. All the peripherals I needed to make magic happen.\n\n# How?\n\nThe core of this software is its [HID report](main/hid_device_le_prf.c#L39-L70), and [esp_hidd_send_joystick_value](main/esp_hidd_prf_api.c#L144-L157) which transmits the current state of the joystick.\n\nTo read the analogue joystick x and y values I am using the [adc driver](https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/peripherals/adc.html).\n\n# Building\n\nThis project uses [esp-idf](https://github.com/espressif/esp-idf) and requires a recent version with support for [CMake](https://cmake.org/).\n\n# Usage\n\nThe below image shows this joystick detected by chrome after being paired.\n\n![Gamepad Detected In Chrome](docs/images/gamepad-detected.png)\n\nHandy gamepad tester used is located at http://luser.github.io/gamepadtest/\n\n# Assembly\n\nTODO Circuit diagram.\n\nJ1 connector.\n\nP6 3v3\nP5 Sw01     GPIO_14\nP4 Sw02     GPIO_25\nP3 Sw03     GPIO_26\nP2 Sw04     GPIO_27\nP1 GND\n\nJ2 connector\n\nP1 Sw10     GPIO_19\nP2 Sw09     GPIO_18\nP3 Sw08     GPIO_17\nP4 Sw07     GPIO_16\nP5 Sw06     GPIO_05\nP6 Sw05     GPIO_04\n\nLEFT_X GPIO_32\nLEFT_Y GPIO_33\nRIGHT_X GPIO_34\nRIGHT_Y GPIO_35\n\n# TODO\n\n* [ ] Make a simple case and wire up a 1S battery\n* [ ] Cleanup demo code once I have done some integration testing.\n* [ ] Extend it to add a screen, this requires more HID stuff which is challenging.\n* [ ] Add add an identify option using an RGB LED so the user knows which is theirs. There is already an LED setup in the HID code.\n\n# Dependencies\n\n* https://github.com/craftmetrics/esp32-button\n\n# References \n\n* https://eleccelerator.com/tutorial-about-usb-hid-report-descriptors/\n* https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf\n\n# License\n\nThis project is copyright Mark Wolfe and Espressif Systems (Shanghai) PTE LTD and is released under Apache 2.0 license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolfeidau%2Fesp32-hid-joystick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwolfeidau%2Fesp32-hid-joystick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolfeidau%2Fesp32-hid-joystick/lists"}