{"id":21056613,"url":"https://github.com/waveshareteam/joystick","last_synced_at":"2025-05-15T23:33:15.573Z","repository":{"id":95584342,"uuid":"126141734","full_name":"waveshareteam/JoyStick","owner":"waveshareteam","description":null,"archived":false,"fork":false,"pushed_at":"2018-03-22T01:40:33.000Z","size":5,"stargazers_count":7,"open_issues_count":0,"forks_count":16,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T17:11:14.459Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/waveshareteam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2018-03-21T07:46:08.000Z","updated_at":"2023-06-22T17:53:54.000Z","dependencies_parsed_at":"2023-04-24T13:34:12.934Z","dependency_job_id":null,"html_url":"https://github.com/waveshareteam/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/waveshareteam%2FJoyStick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waveshareteam%2FJoyStick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waveshareteam%2FJoyStick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waveshareteam%2FJoyStick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waveshareteam","download_url":"https://codeload.github.com/waveshareteam/JoyStick/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442429,"owners_count":22071864,"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":[],"created_at":"2024-11-19T16:52:15.442Z","updated_at":"2025-05-15T23:33:15.550Z","avatar_url":"https://github.com/waveshareteam.png","language":"TypeScript","readme":"# WSJoyStick\n\nWaveshare electronic\n\n## TODO\n\n- [ ] Add a reference for your blocks here\n- [ ] Add \"icon.png\" image (300x200) in the root folder\n- [ ] Add \"- beta\" to the GitHub project description if you are still iterating it.\n- [ ] Turn on your automated build on https://travis-ci.org\n- [ ] Use \"pxt bump\" to create a tagged release on GitHub\n- [ ] Get your package reviewed and approved https://makecode.microbit.org/packages/approval\n\nRead more at https://makecode.microbit.org/packages/build-your-own\n\n## License\n\nMIT\n\n## Supported targets\n\n* for PXT/microbit\n(The metadata above is needed for package search.)\n\n##################\n#initialization\n#First use this module need to initialize the module, otherwise the rocker does not work\nWSJoyStick.JoyStickInit()\n\n\n##################\n#Listening button\nKEY = P, A, B, C, D, E, F,\n\nif (WSJoyStick.Listen_Key(KEY.P)) {\n\t#event\n}\n\nWSJoyStick.onKey(KEY.P, () =\u003e {\n\t#event\n})\n\n#example 1:\nWSJoyStick.onKey(KEY.P, () =\u003e {\n    basic.showLeds(`\n        . # # # .\n        . # . # .\n        . # # # .\n        . # . . .\n        . # . . .\n        `)\n})\n\n#example 2:\nif (WSJoyStick.Listen_Key(KEY.P)) {\n    basic.showLeds(`\n        . # # # .\n        . # . # .\n        . # # # .\n        . # . . .\n        . # . . .\n        `)\n}\n\n\n##################\n#Listening rocker\nDIR = NONE, U, D, L, R, U_L, U_R, D_L, D_R\n\nif (WSJoyStick.Listen_Dir(DIR.NONE)) {\n\t\n}\n\n#example:\nif (WSJoyStick.Listen_Dir(DIR.NONE)) {\n    images.arrowImage(ArrowNames.North).showImage(0)\n}\n\n\n##################\n#Play Music\n\n#example:\nWSJoyStick.PlayMusic(262, music.beat(BeatFraction.Whole))\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaveshareteam%2Fjoystick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaveshareteam%2Fjoystick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaveshareteam%2Fjoystick/lists"}