Closed zhai1987 closed 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
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.
Yes. It is only for ESP32
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 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.
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.
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.
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.
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>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADWOYO3TIRSTIAWSVNAUQXLTG6RKZANCNFSM42BELTLA>.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
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 @.> 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.
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>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADWOYO3TIRSTIAWSVNAUQXLTG6RKZANCNFSM42BELTLA>.
― 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.
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.
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 @.> 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 GitHub<https://github.com/lemmingDev/ESP32-BLE-Gamepad/issues/52#issuecomment-812957679>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADWOYO63BB2T63SWV2A2C2TTG7DJ7ANCNFSM42BELTLA>.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
No
Try in Github, not on you email
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.
Please use a PC instead of phone, or post a link to the pictures
Thanks
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?
brother. Can you see the circuit diagram in the picture... Can you help to change the firmware? Thank you very much for your help
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 .
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.
Using a 4 x 3 button matrix (JP1 to jp12) Four encoders, others are switch keys
Using the 4 x 3 button matrix (JP1 to jp12) Four encoders jp13 to jp16 P13 to jp18 are paddle switches
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.
发自我的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>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADWOYO46QJII3NBEEAG3TQDTG7SY7ANCNFSM42BELTLA>.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
发自我的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>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADWOYO46QJII3NBEEAG3TQDTG7SY7ANCNFSM42BELTLA>.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
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?
Oh - so the rotary encoders also have a button, so there will be 16 buttons total in the button matrix?
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.
Brother, I look forward to your help! thank!
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);
}
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.
So - The matrix is working perfectly?
In your diagram, what are these 2 things?
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.
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?
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.
So
The button at position 17 is connected to pin 33
and
The button at position 18 is also connected to pin 33?
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.
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?
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.
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?
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.
ok - I think I understand
it is late here - I will look at it again tomorrow
Brother, thank you very much! Looking forward to your firmware!
I'm not sure Is it just the pin 14 row that doesn't work? Do rows connected to pins 15 and 16 work?
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.
Try to change:
uint8_t rowPins[ROWS] = {13, 14, 15, 16};
to
uint8_t rowPins[ROWS] = {16, 15, 14, 13};
Actually, perhaps its
uint8_t rowPins[ROWS] = {13, 14, 15, 16}; uint8_t colPins[COLS] = {21, 19, 18, 17};
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
Hi. Brother. Can you share your wiring diagram? Do you have contact information?