Archive:WiFiJoystick: Difference between revisions
Jump to navigation
Jump to search
You are visiting an old member project. The information found on "WiFiJoystick" might be out of date.
(initial page (t.b.d.)) |
m (Vrs moved page WiFiJoystick to Archive:WiFiJoystick without leaving a redirect) |
||
(11 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{outdated|type=member project}} | |||
[[File:WiFiJoystick_joystick.jpg|left|thumb|one of the big and heavy joysticks]] | |||
{{project | {{project | ||
|name = WiFiJoystick | |name = WiFiJoystick | ||
Line 12: | Line 15: | ||
|download = | |download = | ||
}} | }} | ||
This page shows a short description of how to create a WiFi enabled Gamepad / Joystick. The WiFiJoysticks can be used to play games on LED-Panels on events like makerfaires. | |||
== | <br style="clear:both;" /> | ||
= source code = | |||
[https://github.com/munichmakerlab/WiFiJoystick github] | |||
= joystick & buttons = | |||
== pin mapping == | |||
[[File:WiFiJoystick_pins_color.jpg|right|thumb|pins/contacts (see table for color codes)]] | |||
{| class="wikitable" | |||
! function | |||
! state 1 | |||
! state 2 | |||
! state 3 | |||
|- | |||
| Push Button | |||
| [[File:WiFiJoystick_pushbutton.png|50px]] | |||
| | |||
| | |||
|- | |||
| left | |||
| [[File:WiFiJoystick_left1.png|50px]] | |||
| [[File:WiFiJoystick_left2.png|100px]] | |||
| [[File:WiFiJoystick_left3.png|150px]] | |||
|- | |||
| right | |||
| [[File:WiFiJoystick_right1.png|50px]] | |||
| [[File:WiFiJoystick_right2.png|100px]] | |||
| [[File:WiFiJoystick_right3.png|150px]] | |||
|- | |||
| up | |||
| [[File:WiFiJoystick_up1.png|50px]] | |||
| [[File:WiFiJoystick_up2.png|100px]] | |||
| [[File:WiFiJoystick_up3.png|150px]] | |||
|- | |||
| down | |||
| [[File:WiFiJoystick_down1.png|50px]] | |||
| [[File:WiFiJoystick_down2.png|100px]] | |||
| [[File:WiFiJoystick_down3.png|150px]] | |||
|} | |||
<br style="clear:both;" /> | |||
== | == mqtt topics (receive) == | ||
{| class="wikitable" | |||
! topic | |||
! payload | |||
! example | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/config | |||
| flags to configure | |||
| '''reboot''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/brightness | |||
| brightness from 0 to 255 | |||
| '''190''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/debounce/push | |||
| debounce delay in ms | |||
| '''200''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/debounce/button1 | |||
| debounce delay in ms | |||
| '''200''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/debounce/button2 | |||
| debounce delay in ms | |||
| '''200''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/debounce/left | |||
| state1,state2,state3 (debounce delay in ms) | |||
| '''150,100,200''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/debounce/right | |||
| state1,state2,state3 (debounce delay in ms) | |||
| '''150,100,200''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/debounce/up | |||
| state1,state2,state3 (debounce delay in ms) | |||
| '''150,100,200''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/debounce/down | |||
| state1,state2,state3 (debounce delay in ms) | |||
| '''150,100,200''' | |||
|} | |||
== mqtt messages (sending) == | |||
{| class="wikitable" | |||
! topic | |||
! payload | |||
! example | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/button/push | |||
| press or release | |||
| '''press''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/button/button1 | |||
| press or release | |||
| '''press''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/button/button2 | |||
| press or release | |||
| '''press''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/button/left1 | |||
| press or release | |||
| '''press''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/button/left2 | |||
| press or release | |||
| '''press''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/button/left3 | |||
| press or release | |||
| '''press''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/button/right1 | |||
| press or release | |||
| '''press''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/button/right2 | |||
| press or release | |||
| '''press''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/button/right3 | |||
| press or release | |||
| '''press''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/button/up1 | |||
| press or release | |||
| '''press''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/button/up2 | |||
| press or release | |||
| '''press''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/button/up3 | |||
| press or release | |||
| '''press''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/button/down1 | |||
| press or release | |||
| '''press''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/button/down2 | |||
| press or release | |||
| '''press''' | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/button/down3 | |||
| press or release | |||
| '''press''' | |||
|} | |||
= status LEDs = | |||
== mqtt topics (receive) == | |||
{| class="wikitable" | {| class="wikitable" | ||
! | ! topic | ||
! | ! payload | ||
! example | |||
|- | |- | ||
| | | WiFiJoystick/<CHIP-ID>/color/led1 | ||
| | | solid/once/flash/fade,red,green,blue(,interval,red2,green2,blue2) | ||
| <p>'''solid,255,0,0''' <br/>(solid red)</p><p>'''once,0,255,255,5000''' <br/>(pink for 5s)</p> | |||
|- | |||
| WiFiJoystick/<CHIP-ID>/color/led2 | |||
| solid/once/flash/fade,red,green,blue(,interval,red2,green2,blue2) | |||
| <p>'''fade,255,0,0,2000,0,255,0''' <br/>(fade from red to green in 2s)</p><p>'''flash,0,0,255,500''' <br/>(flash from blue to black every 500ms)</p><p>'''flash,255,0,0,1000,255,255,0''' <br/>(flash from red to yellow every 1s)</p> | |||
|} | |} | ||
= I2C IO expander = | |||
The ESP8266 has too less IO pins - so we will use IO expander ICs with serial interface (I²C-Bus): | |||
* [https://www.reichelt.de/index.html?ACTION=3;ARTICLE=140074;SEARCH=MCP%2023017-E/SP MCP 23017-E/SP (16-Bit I/O Expander with I²C-Bus Interface)] | |||
* [https://www.reichelt.de/PCF-8574-T/3/index.html?&ACTION=3&LA=446&ARTICLE=39885&artnr=PCF+8574+T&SEARCH=PCF+8574+T PCF 8574 T (8-Bit I/O Expander with I²C-Bus Interface)] | |||
[[Category:Project]] | [[Category:Project]] |
Latest revision as of 16:18, 10 September 2022
WiFiJoystick Release status: experimental [box doku] | |
---|---|
Description | WiFi connected Joystick and Gamepad |
Author(s) | Jorgen |
This page shows a short description of how to create a WiFi enabled Gamepad / Joystick. The WiFiJoysticks can be used to play games on LED-Panels on events like makerfaires.
source code
joystick & buttons
pin mapping
function | state 1 | state 2 | state 3 |
---|---|---|---|
Push Button | |||
left | |||
right | |||
up | |||
down |
mqtt topics (receive)
topic | payload | example |
---|---|---|
WiFiJoystick/<CHIP-ID>/config | flags to configure | reboot |
WiFiJoystick/<CHIP-ID>/brightness | brightness from 0 to 255 | 190 |
WiFiJoystick/<CHIP-ID>/debounce/push | debounce delay in ms | 200 |
WiFiJoystick/<CHIP-ID>/debounce/button1 | debounce delay in ms | 200 |
WiFiJoystick/<CHIP-ID>/debounce/button2 | debounce delay in ms | 200 |
WiFiJoystick/<CHIP-ID>/debounce/left | state1,state2,state3 (debounce delay in ms) | 150,100,200 |
WiFiJoystick/<CHIP-ID>/debounce/right | state1,state2,state3 (debounce delay in ms) | 150,100,200 |
WiFiJoystick/<CHIP-ID>/debounce/up | state1,state2,state3 (debounce delay in ms) | 150,100,200 |
WiFiJoystick/<CHIP-ID>/debounce/down | state1,state2,state3 (debounce delay in ms) | 150,100,200 |
mqtt messages (sending)
topic | payload | example |
---|---|---|
WiFiJoystick/<CHIP-ID>/button/push | press or release | press |
WiFiJoystick/<CHIP-ID>/button/button1 | press or release | press |
WiFiJoystick/<CHIP-ID>/button/button2 | press or release | press |
WiFiJoystick/<CHIP-ID>/button/left1 | press or release | press |
WiFiJoystick/<CHIP-ID>/button/left2 | press or release | press |
WiFiJoystick/<CHIP-ID>/button/left3 | press or release | press |
WiFiJoystick/<CHIP-ID>/button/right1 | press or release | press |
WiFiJoystick/<CHIP-ID>/button/right2 | press or release | press |
WiFiJoystick/<CHIP-ID>/button/right3 | press or release | press |
WiFiJoystick/<CHIP-ID>/button/up1 | press or release | press |
WiFiJoystick/<CHIP-ID>/button/up2 | press or release | press |
WiFiJoystick/<CHIP-ID>/button/up3 | press or release | press |
WiFiJoystick/<CHIP-ID>/button/down1 | press or release | press |
WiFiJoystick/<CHIP-ID>/button/down2 | press or release | press |
WiFiJoystick/<CHIP-ID>/button/down3 | press or release | press |
status LEDs
mqtt topics (receive)
topic | payload | example |
---|---|---|
WiFiJoystick/<CHIP-ID>/color/led1 | solid/once/flash/fade,red,green,blue(,interval,red2,green2,blue2) | solid,255,0,0 once,0,255,255,5000 |
WiFiJoystick/<CHIP-ID>/color/led2 | solid/once/flash/fade,red,green,blue(,interval,red2,green2,blue2) | fade,255,0,0,2000,0,255,0 flash,0,0,255,500 flash,255,0,0,1000,255,255,0 |
I2C IO expander
The ESP8266 has too less IO pins - so we will use IO expander ICs with serial interface (I²C-Bus):