{"id":22887178,"url":"https://github.com/electrostat-lab/joystickmodule","last_synced_at":"2026-02-16T12:33:59.872Z","repository":{"id":104899750,"uuid":"327817186","full_name":"Electrostat-Lab/JoyStickModule","owner":"Electrostat-Lab","description":"A Java Library to control a Jme Vehicle/CharacterControl/etc w/ an arduino JoyStick module using Pi4J implemented from native WiringPI","archived":false,"fork":false,"pushed_at":"2022-07-24T11:27:51.000Z","size":3117,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-14T21:44:20.433Z","etag":null,"topics":["electrostat-lab","java","jmonkeyengine3","joystick-control","pi4j","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Java","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/Electrostat-Lab.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":"2021-01-08T06:24:30.000Z","updated_at":"2024-08-09T18:41:30.000Z","dependencies_parsed_at":"2023-07-26T04:30:17.698Z","dependency_job_id":null,"html_url":"https://github.com/Electrostat-Lab/JoyStickModule","commit_stats":null,"previous_names":["electrostat-lab/joystickmodule","software-hardware-codesign/joystickmodule"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/Electrostat-Lab/JoyStickModule","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Electrostat-Lab%2FJoyStickModule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Electrostat-Lab%2FJoyStickModule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Electrostat-Lab%2FJoyStickModule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Electrostat-Lab%2FJoyStickModule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Electrostat-Lab","download_url":"https://codeload.github.com/Electrostat-Lab/JoyStickModule/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Electrostat-Lab%2FJoyStickModule/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29507905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["electrostat-lab","java","jmonkeyengine3","joystick-control","pi4j","raspberry-pi"],"created_at":"2024-12-13T20:31:10.250Z","updated_at":"2026-02-16T12:33:59.850Z","avatar_url":"https://github.com/Electrostat-Lab.png","language":"Java","readme":"# \u003cimg src=\"https://user-images.githubusercontent.com/60224159/180644772-63823efd-f2cf-4d13-bef5-03c92c784d52.svg\" width=\"65\" height=\"85\"\u003e JoyStickModule\n\n[![](https://jitpack.io/v/Scrappers-glitch/JoystickModule.svg)](https://jitpack.io/#Scrappers-glitch/JoystickModule)\n\n## In order to use the Library : ##\n\n```gradle\nallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\n\n```gradle\ndependencies {\n\t        implementation 'com.github.Scrappers-glitch:JoystickModule:1.0.1R'\n\t}\n```\n\n## Description :\nSince , RPIs got no analog I/O pins , you cannot get direct analog mappings using the PI , so in order to read analog mappings ```0~1023``` as a hardware mapping or ```0%~100%``` as a pulse duty cycle , you will need to convert analog outputs to digital inputs through SPI (Serial peripheral Interface) of the PI\n\nIn order to find the wiringPI pins(wPi column on right \u0026 Left for RT \u0026 LT pins) on your device :\n\n```bash\npi@raspberrypi:~ $ gpio readall\n +-----+-----+---------+------+---+---Pi 4B--+---+------+---------+-----+-----+\n | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |\n +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+\n |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |\n |   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5v      |     |     |\n |   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |\n |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 1 | IN   | TxD     | 15  | 14  |\n |     |     |      0v |      |   |  9 || 10 | 1 | IN   | RxD     | 16  | 15  |\n |  17 |   0 | GPIO. 0 |  OUT | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |\n |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |\n |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |\n |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |\n |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |\n |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |\n |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |\n |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |\n |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |\n |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |\n |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |\n |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |\n |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |\n |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |\n |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |\n +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+\n | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |\n +-----+-----+---------+------+---+---Pi 4B--+---+------+---------+-----+-----+\n```\n\n\n## Attachments : \n\n### Wrining PI for RPI4b \u0026 RPI3b :\n\n![](https://github.com/Scrappers-glitch/JoyStickModule/blob/master/Attachments/j8header-3b.png)\n\n### JoyStick Module Mappings in Vx \u0026 Vy where Vx is the potential difference across the POTx(potentiometer X) \u0026 Vy is the potential difference across the POTy(potentiometer y) :\n\n![](https://github.com/Scrappers-glitch/JoyStickModule/blob/master/Attachments/Joystick-Module-Analog-Output.png)\n\n### Arduino JoyStick Module Datasheet (NB: examples are in Arduinos) : \n\nhttps://github.com/Scrappers-glitch/JoyStickModule/blob/master/Attachments/joystick_module.pdf\n\n### MCP3008 Channel \u0026 Communication Pins :\n\n![](https://github.com/Scrappers-glitch/JoyStickModule/blob/master/Attachments/mcp3008pins.png)\n\n### MCP3008 MicroChip ADC(Analog~Digital Converter) datasheet :\n\nhttps://github.com/Scrappers-glitch/JoyStickModule/blob/master/Attachments/MCP3008.pdf\n\n### If you need to know more about MCP3008 at MicroChip : \n\nhttps://www.microchip.com/wwwproducts/en/en010530#additional-features\n\n### So , Generally do like this : \n\n```bash\nVDD(driving device) -\u003e 3v3 source.\nVref(reference voltage) -\u003e 3v3 source.\nAGND(Analog ground for closed circuit during analogRead transmission) -\u003e GND.\nCLK -\u003e SCLK pin of the SPI0 , GPIO14 or physical pin 23 of PI4.\nDOUT(the converted digital out of the MCP3008) -\u003e MISO0(Master-in slave-out) of the SPI0 , GPIO13 or physical pin 21 of PI4.\nDIN(Digital input from the PI4, for MCP3008 channels configuration as PI4 digitalOut) -\u003e MOSI0(Master-out slave-in) of the SPI0 , GPIO12 or physical pin 19.\nCS/SHDN(Chip Select or Chip Enable : used to select which SPI to enable as PI4b has 4 SPIs) -\u003e CE0(Chip enable 0) , GPIO10 or physical pin 24 to enable SPI0.\nDGND(Digital ground for closing circuit during digitalOut transmission) -\u003e GND.\n\n```\n\n### Then on the joystick module there are 5 pins : \n\n```bash\nGND -\u003e GND \n+5v -\u003e 5v0 or 3v3 source (it's tested in both cases)\nVRx -\u003e CH0 or CH1 or CH2 or CH3 or CH4 or CH5 or CH6 or CH7 according to your code setup but it should differs from VRy\nVRy -\u003e CH0 or CH1 or CH2 or CH3 or CH4 or CH5 or CH6 or CH7 according to your code setup but it should differs from VRx\nSW(switch button pin) -\u003e GPIO7 or pin7 for digital input ( i think you can still use MCP3008 channels as digitalInputs too with provisionDigitalInput(Pin) code setup , try it \u0026 tell e if it works :-) ). \n\n```\n\n### A photo for the Breadboard circuit :\n\n![](https://github.com/Scrappers-glitch/JoyStickModule/blob/master/Attachments/IMG_20210109_145230.jpg)\n\n### Video of Operation :\n\nhttps://youtu.be/9ZvhFQSwHF0\n\n-----------------------------------------------------------------------------------------------------------\n\n### More at : \n- Pi4j Examples : https://github.com/Scrappers-glitch/pi4j-v1/tree/master/pi4j-example/src/main/java\n- wPi Examples : https://github.com/WiringPi/WiringPi/tree/master/examples\n- Raspberry Pi : https://www.raspberrypi.com/documentation/computers/raspberry-pi.html\n- JMonkeyEngine : https://jmonkeyengine.org/docs/\n- Test `JoyStickModule` lib : https://github.com/Scrappers-glitch/JmeCarPhysicsTestRPI\n- SPI (Serial Peripheral Interface) : https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi/all\n \t\t\t\t      https://en.wikipedia.org/wiki/Serial_Peripheral_Interface\n- MCP3008 ADC : https://www.microchip.com/en-us/product/MCP3008\n\n### General References :\n- General electronics : https://www.electronics-tutorials.ws/combination/analogue-to-digital-converter.html\n- RPI intoduced by oracle press thro pi4j1.4 : https://eg1lib.org/book/5173454/11911d\n- Pi4J website and docs : https://pi4j.com/1.4/example/control.html \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectrostat-lab%2Fjoystickmodule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felectrostat-lab%2Fjoystickmodule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectrostat-lab%2Fjoystickmodule/lists"}