lemmingDev / ESP32-BLE-Gamepad

Bluetooth LE Gamepad library for the ESP32
Other
1.09k stars 179 forks source link

Esp32 ble hub controller #52

Closed zhai1987 closed 3 years ago

zhai1987 commented 3 years ago

Hi. Brother. Can you share your wiring diagram? Do you have contact information?

lemmingDev commented 3 years ago

Hi

The wiring is highly dependant on your own board and what features you're trying to get working.

You just wire up the number of buttons and axis you want according to your needs and ignore the stuff you don't need.

If I ever get around to finishing it, I'm working on a version that has a customisable HID report (features) similar to this one: https://github.com/MHeironimus/ArduinoJoystickLibrary/tree/version-2.0

zhai1987 commented 3 years ago

Brother. Is your firmware suitable for Esp32?

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Fri,Apr 2,2021 4:20 AM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Hi

The wiring is highly dependant on your own board and what features you're trying to get working.

You just wire up the number of buttons and axis you want according to your needs and ignore the stuff you don't need.

If I ever get around to finishing it, I'm working on a version that has a customisable HID report (features) similar to this one: https://github.com/MHeironimus/ArduinoJoystickLibrary/tree/version-2.0

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lemmingDev commented 3 years ago

Yes. It is only for ESP32

zhai1987 commented 3 years ago

Can I just swipe your firmware. Do I have the right wiring diagram?

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Fri,Apr 2,2021 4:37 PM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Yes. It is only for ESP32

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lemmingDev commented 3 years ago

You have to do a lot of programming yourself to get it to work with your hardware.

How many buttons do you need?

Which axes do you need? What hardware are you using for analog axes, if any?

How many hat switches do you need?


From: zhai1987 @.> Sent: 02 April 2021 08:41 To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: lemmingDev @.>; Comment @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Can I just swipe your firmware. Do I have the right wiring diagram?

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Fri,Apr 2,2021 4:37 PM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Yes. It is only for ESP32

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

― You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/lemmingDev/ESP32-BLE-Gamepad/issues/52#issuecomment-812419044, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADWOYOYXKXEJGCQHSANN3J3TGV7KNANCNFSM42BELTLA.

lemmingDev commented 3 years ago

Hi

If you create code that will get your hardware working to output serial messages when the dials and potentiometers are turned, then I will help you getting my library working with it as a gamepad.

zhai1987 commented 3 years ago

Brother. Right. I want to use your library to make a Bluetooth game box. Well, thank you very much for your help. Can I share my wiring diagram with. Help change the code?

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Sun,Apr 4,2021 7:17 AM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Hi

If you create code that will get your hardware working to output serial messages when the dials and potentiometers are turned, then I will help you getting my library working with it as a gamepad.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lemmingDev commented 3 years ago

Sure

Do you have any working examples for the dials though, as I don't have any of the same for testing


From: zhai1987 @.> Sent: 03 April 2021 23:39 To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: lemmingDev @.>; Comment @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Brother. Right. I want to use your library to make a Bluetooth game box. Well, thank you very much for your help. Can I share my wiring diagram with. Help change the code?

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Sun,Apr 4,2021 7:17 AM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Hi

If you create code that will get your hardware working to output serial messages when the dials and potentiometers are turned, then I will help you getting my library working with it as a gamepad.

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

― You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/lemmingDev/ESP32-BLE-Gamepad/issues/52#issuecomment-812941410, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADWOYO3TIRSTIAWSVNAUQXLTG6RKZANCNFSM42BELTLA.

zhai1987 commented 3 years ago

I only have the drawings of the pcb controller sep32 here. But I don't know how to share it with you. You played app. Can I send a picture?

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Sun,Apr 4,2021 7:54 AM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Sure

Do you have any working examples for the dials though, as I don't have any of the same for testing


From: zhai1987 @.> Sent: 03 April 2021 23:39 To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: lemmingDev @.>; Comment @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Brother. Right. I want to use your library to make a Bluetooth game box. Well, thank you very much for your help. Can I share my wiring diagram with. Help change the code?

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Sun,Apr 4,2021 7:17 AM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Hi

If you create code that will get your hardware working to output serial messages when the dials and potentiometers are turned, then I will help you getting my library working with it as a gamepad.

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

― You are receiving this because you commented. Reply to this email directly, view it on GitHub<https://github.com/lemmingDev/ESP32-BLE-Gamepad/issues/52#issuecomment-812941410&gt;, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADWOYO3TIRSTIAWSVNAUQXLTG6RKZANCNFSM42BELTLA&gt;.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lemmingDev commented 3 years ago

You should be able to paste it in the message window

If not, give me the link

Also, what pins are you using


From: zhai1987 @.> Sent: 04 April 2021 00:15 To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: lemmingDev @.>; Comment @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

I only have the drawings of the pcb controller sep32 here. But I don't know how to share it with you. You played app. Can I send a picture?

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Sun,Apr 4,2021 7:54 AM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Sure

Do you have any working examples for the dials though, as I don't have any of the same for testing


From: zhai1987 @.> Sent: 03 April 2021 23:39 To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: lemmingDev @.>; Comment @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Brother. Right. I want to use your library to make a Bluetooth game box. Well, thank you very much for your help. Can I share my wiring diagram with. Help change the code?

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.&gt; Date: Sun,Apr 4,2021 7:17 AM To: lemmingDev/ESP32-BLE-Gamepad @.&gt; Cc: zhai1987 @.&gt;, Author @.&gt; Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Hi

If you create code that will get your hardware working to output serial messages when the dials and potentiometers are turned, then I will help you getting my library working with it as a gamepad.

D You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

D You are receiving this because you commented. Reply to this email directly, view it on GitHub<https://github.com/lemmingDev/ESP32-BLE-Gamepad/issues/52#issuecomment-812941410&gt;, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADWOYO3TIRSTIAWSVNAUQXLTG6RKZANCNFSM42BELTLA&gt;.

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

― You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/lemmingDev/ESP32-BLE-Gamepad/issues/52#issuecomment-812945852, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADWOYO2FCT5X5OBF7F3FCC3TG6VSBANCNFSM42BELTLA.

lemmingDev commented 3 years ago

Na - I can help you through this thread


From: zhai1987 @.> Sent: 04 April 2021 02:12 To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: lemmingDev @.>; Comment @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Brother. You have Facebook Instagram.

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Sun,Apr 4,2021 10:05 AM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

― You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/lemmingDev/ESP32-BLE-Gamepad/issues/52#issuecomment-812957679, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADWOYO63BB2T63SWV2A2C2TTG7DJ7ANCNFSM42BELTLA.

zhai1987 commented 3 years ago

I share pictures. Can you see it?!

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Sun,Apr 4,2021 10:19 AM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Na - I can help you through this thread


From: zhai1987 @.> Sent: 04 April 2021 02:12 To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: lemmingDev @.>; Comment @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Brother. You have Facebook Instagram.

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.&gt; Date: Sun,Apr 4,2021 10:05 AM To: lemmingDev/ESP32-BLE-Gamepad @.&gt; Cc: zhai1987 @.&gt;, Author @.&gt; Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

― You are receiving this because you commented. Reply to this email directly, view it on GitHub<https://github.com/lemmingDev/ESP32-BLE-Gamepad/issues/52#issuecomment-812957679&gt;, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADWOYO63BB2T63SWV2A2C2TTG7DJ7ANCNFSM42BELTLA&gt;.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lemmingDev commented 3 years ago

No

lemmingDev commented 3 years ago

Try in Github, not on you email

zhai1987 commented 3 years ago

Right. You can't see the picture I sent back. You can only communicate by mailbox.

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Sun,Apr 4,2021 10:33 AM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Reopened #52.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lemmingDev commented 3 years ago

Please use a PC instead of phone, or post a link to the pictures

Thanks

lemmingDev commented 3 years ago

I can see the photos now, but it looks pretty complicated.

So, you're using a 4 x 3 button matrix (JP1 to JP12)? Are JP13 to JP16 also part of a button matrix? What devices are at JP13 to JP18?

zhai1987 commented 3 years ago

brother. Can you see the circuit diagram in the picture... Can you help to change the firmware? Thank you very much for your help

lov7777 commented 3 years ago

I’m here in police station you are agents to use my google account and email just weit

On Sun, 4 Apr 2021 at 06:08, lemmingDev @.***> wrote:

I can see the photos now, but it looks pretty complicated.

So, you're using a 4 x 3 button matrix (JP1 to JP12)? Are JP13 to JP16 also part of a button matrix? What devices are at JP13 to JP1—

You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lemmingDev/ESP32-BLE-Gamepad/issues/52#issuecomment-812967767, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATAJGD5CTE7KJYJJG5AKJHDTG7Q3LANCNFSM42BELTLA .

lemmingDev commented 3 years ago

I can see the circuit diagram

Have you already created that hardware?

What are the exact components at the positions mentioned in my last reply?


From: zhai1987 @.> Sent: 04 April 2021 04:10 To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: lemmingDev @.>; State change @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

brother. Can you see the circuit diagram in the picture... Can you help to change the firmware? Thank you very much for your help

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/lemmingDev/ESP32-BLE-Gamepad/issues/52#issuecomment-812967913, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADWOYOYNCEDLA5OJAUFTWOLTG7RCDANCNFSM42BELTLA.

zhai1987 commented 3 years ago

Using a 4 x 3 button matrix (JP1 to jp12) Four encoders, others are switch keys

zhai1987 commented 3 years ago

Using the 4 x 3 button matrix (JP1 to jp12) Four encoders jp13 to jp16 P13 to jp18 are paddle switches

lemmingDev commented 3 years ago

Do you have a link to the switch keys and encoders?

If you're trying to get everything working, it's best to get one thing working, and then add one extra functionality at a time until it's all working.

I suggest starting with the button matrix


From: zhai1987 @.> Sent: 04 April 2021 04:24 To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: lemmingDev @.>; State change @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Using a 4 x 3 button matrix (JP1 to jp12) Four encoders, others are switch keys

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/lemmingDev/ESP32-BLE-Gamepad/issues/52#issuecomment-812969151, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADWOYO46QJII3NBEEAG3TQDTG7SY7ANCNFSM42BELTLA.

zhai1987 commented 3 years ago

https://www.ebay.com/itm/Rotary-Encoder-EC11-360-6mm-Shaft-Panel-Mount-6mm-Shaft-Arduino-Pi-Flux-Workshop/124276981910?_trkparms=ispr%3D1&amp;hash=item1cef7c4096:g:ELwAAOSwNDVfo2iP&amp;amdata=enc%3AAQAFAAACcBaobrjLl8XobRIiIML1V4Imu%252Fn%252BzU5L90Z278x5ickkp2NA0WuhQytmt4dbStg00CogJUpazgamjuMMAB1z1K4PQFQobwRcpAC0pOYCIhB%252Fdwsoom02NMyd4EE72SKnU81tSLRQBms%252FbCiezGIF427ohIQxOR3RSqFbB6fu5iYhdjuKq6AV4UJvN31GG74Z%252Fb%252B0VXI4zaLwYrmQ%252FSnWqCQlD76109%252B6Wz8LCVu8pWseFfWccMxS1sEnLsQz13tZ02HVaRITC0mJrS8AfMi2UUNpV04RUtyFAXWZA3tW59%252FeEO11qH6Gkxjk3jJEP3fnv7sf9hfyizlYHUR02Gw7G%252F2EpxooxImrx6UqYcKPs3A0b%252BKcn2SRPy3bpUSm58BP1KcHTnJhmosDxYiYa7k58oZMY1SOTXuz%252Bc%252Fyh1gBwOOmlKIbDWO94yMmdoLMWFzjah03wvxkJbMDh77XCIqdVRoIVMya9ddsO3tmNQUIN2nvYh5RMvUiEBah6fpQVZR9%252Bpp8OAOOzXHxK7r5px4rzSqZovi%252BcFfZBJnVRD30v%252FXnmiphfNF0Z4LkdaXxkZUILS%252Bv047d8d%252Bvqb%252BfzXpIx4zvzsjJXwHFoLjIh%252FMX8NHfvGdIpAe2CbqciHxqCka4gV1fkthD6q6WTsoG%252BgR%252F94MoaBvuddRWtL7dWmXtslf%252Fhyk7IL47EM8g%252FA6uzxQBJXVDuyoRabat2yXnI9w8jS6TBO6G%252BTM1%252FXkgexVcJZRYW%252Bl9CwI4XAVP8mvBpdwFOjGwR9FGJAIg8LqftsJsKNPiYG5S9hZRTTlTAH6blo08PMJzEkegveW6ZX5XMVt%252FwA%253D%253D%7Ccksum%3A124276981910240468b1a5724f8d8f92428786651f0c%7Campid%3APL_CLK%7Cclp%3A2334524

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Sun,Apr 4,2021 0:28 PM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Do you have a link to the switch keys and encoders?

If you're trying to get everything working, it's best to get one thing working, and then add one extra functionality at a time until it's all working.

I suggest starting with the button matrix


From: zhai1987 @.> Sent: 04 April 2021 04:24 To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: lemmingDev @.>; State change @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Using a 4 x 3 button matrix (JP1 to jp12) Four encoders, others are switch keys

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub<https://github.com/lemmingDev/ESP32-BLE-Gamepad/issues/52#issuecomment-812969151&gt;, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADWOYO46QJII3NBEEAG3TQDTG7SY7ANCNFSM42BELTLA&gt;.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

zhai1987 commented 3 years ago

https://www.ebay.com/itm/5-x-SmartSwitch-SPST-12mm-IP67-Round-Head-Momentary-Plastic-Buttons/142074255526?hash=item21144918a6:g:1-YAAOSwoLFenNev

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Sun,Apr 4,2021 0:28 PM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Do you have a link to the switch keys and encoders?

If you're trying to get everything working, it's best to get one thing working, and then add one extra functionality at a time until it's all working.

I suggest starting with the button matrix


From: zhai1987 @.> Sent: 04 April 2021 04:24 To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: lemmingDev @.>; State change @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Using a 4 x 3 button matrix (JP1 to jp12) Four encoders, others are switch keys

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub<https://github.com/lemmingDev/ESP32-BLE-Gamepad/issues/52#issuecomment-812969151&gt;, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADWOYO46QJII3NBEEAG3TQDTG7SY7ANCNFSM42BELTLA&gt;.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lemmingDev commented 3 years ago

Is it possible to show me a photo of everything connected to the ESP32, just so I get a sense of how it all looks?

lemmingDev commented 3 years ago

Oh - so the rotary encoders also have a button, so there will be 16 buttons total in the button matrix?

zhai1987 commented 3 years ago

Right. It's just that one encoder can give three signals.

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Sun,Apr 4,2021 1:13 PM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Oh - so the rotary encoders also have a button, so there will be 16 buttons total in the button matrix?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

zhai1987 commented 3 years ago

QQ图片20210404145129

zhai1987 commented 3 years ago

QQ图片20210404145255

zhai1987 commented 3 years ago

Brother, I look forward to your help! thank!

lemmingDev commented 3 years ago

I suggest you use the latest test version of my library ESP32-BLE-Gamepad.zip

You'll also need these 2 libraries https://github.com/Chris--A/Keypad https://github.com/h2zero/NimBLE-Arduino

Ok - let's start by getting the button matrix to work

/*
 * Custom controller for zhai1987
*/

#include <Keypad.h>       // https://github.com/Chris--A/Keypad
#include <BleGamepad.h>   // https://github.com/lemmingDev/ESP32-BLE-Gamepad

BleGamepad bleGamepad("ESP32 Keypad", "lemmingDev", 100);   //Shows how you can customise the device name, manufacturer name and initial battery level

#define ROWS 4
#define COLS 4
uint8_t rowPins[ROWS] = {13, 14, 15, 16};    //ESP32 pins used for rows      --> adjust to suit --> Pinout on board: R1, R2, R3, R4
uint8_t colPins[COLS] = {17, 18, 19, 21};    //ESP32 pins used for columns   --> adjust to suit --> Pinout on board: Q1, Q2, Q3, Q4
uint8_t keymap[ROWS][COLS] = 
{
  {0,1,2,3},          //Buttons  1,  2,  3,  4      --> Used for calulating the bitmask for sending to the library 
  {4,5,6,7},          //Buttons  5,  6,  7,  8      --> Adjust to suit which buttons you want the library to send
  {8,9,10,11},        //Buttons  9, 10, 11, 12      --> Just take 1 off the button number as shown to the left
  {12,13,14,15}       //Buttons 13, 14, 15, 16      --> Eg. The value 12 in the array refers to button 13
};

Keypad customKeypad = Keypad( makeKeymap(keymap), rowPins, colPins, ROWS, COLS);

void KeypadUpdate()
{
  customKeypad.getKeys();

  for (int i=0; i<LIST_MAX; i++)   // Scan the whole key list.      //LIST_MAX is provided by the Keypad library and gives the number of buttons of the Keypad instance
  {
      if ( customKeypad.key[i].stateChanged )   //Only find keys that have changed state.
      {
        uint8_t keystate = customKeypad.key[i].kstate;

        if(bleGamepad.isConnected()) 
        {
          if (keystate==PRESSED) {  bleGamepad.press(pow(2,(int(customKeypad.key[i].kchar)))); }    //Press or release button based on the current state
          if (keystate==RELEASED) { bleGamepad.release(pow(2,(int(customKeypad.key[i].kchar)))); }

          bleGamepad.sendReport();    //Send the HID report after values for all button states are updated, and at least one button state had changed
        }
      }
  }
}

void setup() 
{
  bleGamepad.begin();               //Begin library with default buttons/hats/axes
  bleGamepad.setAutoReport(false);  //Disable auto reports --> You then need to force HID updates with bleGamepad.sendReport()
}

void loop() 
{
  KeypadUpdate();
  delay(10);
}
zhai1987 commented 3 years ago

Great. Now you can press the matrix.

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Sun,Apr 4,2021 3:17 PM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

I suggest you use the latest test version of my library ESP32-BLE-Gamepad.zip

You'll also need these 2 libraries https://github.com/Chris--A/Keypad https://github.com/h2zero/NimBLE-Arduino

Ok - let's start by getting the button matrix to work / Custom controller for zhai1987 */ #include <Keypad.h> // https://github.com/Chris--A/Keypad #include <BleGamepad.h> // https://github.com/lemmingDev/ESP32-BLE-Gamepad BleGamepad bleGamepad("ESP32 Keypad", "lemmingDev", 100);//Shows how you can customise the device name, manufacturer name and initial battery level #define ROWS 4 #define COLS 4 uint8_t rowPins[ROWS] = {13, 14, 15, 16}; //ESP32 pins used for rows --> adjust to suit --> Pinout on board: R1, R2, R3, R4 uint8_t colPins[COLS] = {17, 18, 19, 21}; //ESP32 pins used for columns --> adjust to suit --> Pinout on board: Q1, Q2, Q3, Q4 uint8_t keymap[ROWS][COLS] = { {0,1,2,3}, //Buttons 1, 2, 3, 4 --> Used for calulating the bitmask for sending to the library {4,5,6,7}, //Buttons 5, 6, 7, 8 --> Adjust to suit which buttons you want the library to send {8,9,10,11}, //Buttons 9, 10, 11, 12 --> Just take 1 off the button number as shown to the left {12,13,14,15} //Buttons 13, 14, 15, 16 --> Eg. The value 12 in the array refers to button 13 }; Keypad customKeypad = Keypad( makeKeymap(keymap), rowPins, colPins, ROWS, COLS); void KeypadUpdate() { customKeypad.getKeys(); for (int i=0; i<LIST_MAX; i++) // Scan the whole key list. //LIST_MAX is provided by the Keypad library and gives the number of buttons of the Keypad instance { if ( customKeypad.key[i].stateChanged ) //Only find keys that have changed state. { uint8_t keystate = customKeypad.key[i].kstate; if(bleGamepad.isConnected()) { if (keystate==PRESSED) { bleGamepad.press(pow(2,(int(customKeypad.key[i].kchar)))); } //Press or release button based on the current state if (keystate==RELEASED) { bleGamepad.release(pow(2,(int(customKeypad.key[i].kchar)))); } bleGamepad.sendReport(); //Send the HID report after values for all button states are updated, and at least one button state had changed } } } } void setup() { bleGamepad.begin();//Begin library with default buttons/hats/axes bleGamepad.setAutoReport(false);//Disable auto reports --> You then need to force HID updates with bleGamepad.sendReport() } void loop() { KeypadUpdate(); delay(10); }
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lemmingDev commented 3 years ago

So - The matrix is working perfectly?

In your diagram, what are these 2 things? image

zhai1987 commented 3 years ago

In fact, these two are also button switches. It's just that he uses a pick to block it!

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Sun,Apr 4,2021 4:31 PM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

So - The matrix is working perfectly?

In your diagram, what are these 2 things?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lemmingDev commented 3 years ago

Why are they both connected to pin 33? So it doesn't matter which one you press, but they both activate the same button?

Also, what axes do you want the 4 encoders mapped to? X, Y, Z and rZ ?

Originally you mentioned potentiometers, but you're not using them any more?

zhai1987 commented 3 years ago

33 is just a common point. This is a separate one. 17 and 18. There are two buttons! The encoder is also used for buttons. An encoder. There are three gears. That's three signals! At first, I thought of adding 2 potentiometers to press the Y.x axis!

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Sun,Apr 4,2021 4:39 PM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Why are they both connected to pin 33? So it doesn't matter which one you press, but they both activate the same button?

Also, what axes do you want the 4 encoders mapped to? X, Y, Z and rZ ?

Originally you mentioned potentiometers, but you're not using them any more?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lemmingDev commented 3 years ago

So

The button at position 17 is connected to pin 33

and

The button at position 18 is also connected to pin 33?

zhai1987 commented 3 years ago

Yeah. You're right. These two are separate signals! Add four encoders and you have 26 signals. 2 potentiometers. So the 16-bit signal is not enough! What do you think, man?

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Sun,Apr 4,2021 4:53 PM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

So

The button at position 17 is connected to pin 33

and

The button at position 18 is also connected to pin 33?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lemmingDev commented 3 years ago

Ok, so are those 2 buttons down the bottom also part of the button matrix, and pin 33 is the row pin?

If so, why only 2 buttons and not 4?

zhai1987 commented 3 years ago

17 and 33 are a signal. 18 and 33 are another signal.

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Sun,Apr 4,2021 5:03 PM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

Ok, so are those 2 buttons down the bottom also part of the button matrix, and pin 33 is the row pin?

If so, why only 2 buttons and not 4?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lemmingDev commented 3 years ago

What functionality do you want the encoders to have with the axes?

Encoders are continuous 360 degrees and can keep rotating Do you want the axis value to reach the max or wrap back around if you keep turning?

zhai1987 commented 3 years ago

Brother. The encoder is not on the shaft. Ec11 encoders function like buttons, except that an encoder has three signals.

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Sun,Apr 4,2021 5:59 PM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

What functionality do you want the encoders to have with the axes?

Encoders are continuous 360 degrees and can keep rotating Do you want the axis value to reach the max or wrap back around if you keep turning?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lemmingDev commented 3 years ago

ok - I think I understand

it is late here - I will look at it again tomorrow

zhai1987 commented 3 years ago

Brother, thank you very much! Looking forward to your firmware!

lemmingDev commented 3 years ago

I'm not sure Is it just the pin 14 row that doesn't work? Do rows connected to pins 15 and 16 work?

zhai1987 commented 3 years ago

Brother. Morning! You're right. Only 13 matches and 17.18.19.21 can be used. 14.15.16 won't work.

发自我的iPhone

------------------ Original ------------------ From: lemmingDev @.> Date: Mon,Apr 5,2021 3:22 AM To: lemmingDev/ESP32-BLE-Gamepad @.> Cc: zhai1987 @.>, Author @.> Subject: Re: [lemmingDev/ESP32-BLE-Gamepad] Hi. Brother. Can you share your wiring diagram? Do you have contact information? (#52)

I'm not sure Is it just the pin 14 row that doesn't work? Do rows connected to pins 15 and 16 work?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lemmingDev commented 3 years ago

Try to change:

uint8_t rowPins[ROWS] = {13, 14, 15, 16};

to

uint8_t rowPins[ROWS] = {16, 15, 14, 13};

lemmingDev commented 3 years ago

Actually, perhaps its

uint8_t rowPins[ROWS] = {13, 14, 15, 16}; uint8_t colPins[COLS] = {21, 19, 18, 17};

zhai1987 commented 3 years ago

uint8_t rowPins [ROWS] = {13、14、15、16};

uint8_t rowPins [ROWS] = {16,15,14,13}; uint8_t rowPins[ROWS] = {13, 14, 15, 16}; //ESP32 pins used for rows --> adjust to suit --> Pinout on board: R1, R2, R3, R4 uint8_t colPins[COLS] = {21, 19, 18, 17}; //ESP32 pins used for columns --> adjust to suit --> Pinout on board: Q1, Q2, Q3, Q4

Brother, after the change, it's still the same. 14.15.16 can't be used