{"id":19551983,"url":"https://github.com/0015/lvgl_joystick","last_synced_at":"2025-06-24T08:35:57.859Z","repository":{"id":255632991,"uuid":"852055905","full_name":"0015/LVGL_Joystick","owner":"0015","description":" Virtual Joystick for LVGL","archived":false,"fork":false,"pushed_at":"2025-02-20T04:42:50.000Z","size":1848,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-23T08:13:57.607Z","etag":null,"topics":["arduino-library","esp-idf","esp-idf-component","joystick-library","lvgl","lvgl9","touchscreen","virtual-joystick"],"latest_commit_sha":null,"homepage":"https://youtu.be/ZhhSd6LA1jA","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0015.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":13}},"created_at":"2024-09-04T06:35:38.000Z","updated_at":"2025-02-20T04:42:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"c55b8697-9cbe-47ca-afea-fd5bc1ac01b6","html_url":"https://github.com/0015/LVGL_Joystick","commit_stats":null,"previous_names":["0015/lvgl_joystick"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0015%2FLVGL_Joystick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0015%2FLVGL_Joystick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0015%2FLVGL_Joystick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0015%2FLVGL_Joystick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0015","download_url":"https://codeload.github.com/0015/LVGL_Joystick/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251051408,"owners_count":21528787,"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":["arduino-library","esp-idf","esp-idf-component","joystick-library","lvgl","lvgl9","touchscreen","virtual-joystick"],"created_at":"2024-11-11T04:16:15.380Z","updated_at":"2025-04-26T20:31:24.405Z","avatar_url":"https://github.com/0015.png","language":"C","funding_links":["https://github.com/sponsors/13"],"categories":[],"sub_categories":[],"readme":"# LVGL Joystick Library\n\nThis library provides an easy way to create virtual joysticks for use in an LVGL environment. It supports both ESP-IDF and Arduino platforms and allows you to handle joystick input with customizable styles and callbacks.\n\n[![Virtual Joystic for LVGL](./misc/demo_1.gif)](https://youtu.be/ZhhSd6LA1jA)\n\n## Features\n\n- Create virtual joysticks with customizable sizes and styles.\n- Handle joystick movement with user-defined callbacks.\n- Allows creation of multiple virtual joysticks, identifiable via ID.\n- Supports both ESP-IDF and Arduino environments.\n\n## Installation\n\n### Arduino\n\n**Install the Joystick Library**:\n   - Download or clone this repository.\n   - Copy the `LVGL_Joystick` folder to your Arduino `libraries` directory.\n\n### ESP-IDF\n\n**Add Joystick Library as a component**:\n   - Clone the LVGL Joystick repository into your `components/` directory:\n\n```bash\nmkdir -p components\ncd components\ngit clone https://github.com/0015/LVGL_Joystick\n```\n\n## Usage\n```cpp   \n    #include \u003clvgl.h\u003e\n    #include \u003cjoystick.h\u003e\n\n    void joystick_position_callback(uint8_t joystick_id, int16_t x, int16_t y) {\n        Serial.printf(\"Joystick ID: %d, Position - X: %d, Y: %d\\n\", joystick_id, x, y);\n    }\n\n    void ui_init() {\n        lv_obj_t *screen = lv_scr_act();\n        create_joystick(screen, 1, LV_ALIGN_CENTER, 0, 0, 100, 25, NULL, NULL, joystick_position_callback);\n    }\n\n```\n**You can check more details in the example project.**\n\n\n## API Reference\n```cpp   \nvoid create_joystick(\n    lv_obj_t *parent,\n    uint8_t joystick_id,\n    lv_align_t base_align,\n    int base_x,\n    int base_y,\n    int base_radius,\n    int stick_radius,\n    lv_style_t *base_style,\n    lv_style_t *stick_style,\n    joystick_position_cb_t position_callback)\n```\n* Creates a joystick on the specified parent object.\n    * lv_obj_t *parent: The parent LVGL object where the joystick will be created.\n    * uint8_t joystick_id: A unique ID for the joystick.\n    * lv_align_t base_align: Alignment for the base object of the joystick.\n    * int base_x, int base_y: X and Y offsets for the base object's position.\n    * int base_radius: The radius of the base (background) circle.\n    * int stick_radius: The radius of the joystick (control) circle.\n    * lv_style_t *base_style: Pointer to a custom style for the base object (can be NULL to use the default style).\n    * lv_style_t *stick_style: Pointer to a custom style for the joystick object (can be NULL to use the default style).\n    *  joystick_position_cb_t position_callback: Callback function for joystick position updates.\n\n\n## Limitations\n\nSince LVGL (the current version 9.2.0) does not support multi-touch, you cannot fire two touch events at the same time. More than two joysticks will be available as soon as LVGL is updated.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0015%2Flvgl_joystick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0015%2Flvgl_joystick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0015%2Flvgl_joystick/lists"}