Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional Buttons (Button Box) #14

Open
DocGibbert opened this issue Aug 29, 2021 · 1 comment
Open

Add additional Buttons (Button Box) #14

DocGibbert opened this issue Aug 29, 2021 · 1 comment

Comments

@DocGibbert
Copy link

first of all, thanks for this wonderful project.
I will use my g29 Shifter with the Arduino Pro Micro as descibed. But i would like to add 4 additional standart buttons (only active if pressed) as a button box. is it possible to do this with 1 arduino (shifter + buttons) or do i have to use 2 boards?
thanks for your help

@Eloton
Copy link

Eloton commented Jan 24, 2024

The project works perfect. Great thanks to the author.
If anyone happened to implement that, please share your experience. For g27 shifter I placed an additional button connected it through DB9 non-used pin5 and to pin5 of my ProMicro. Surprisingly, it also makes shifter power led light up whenewer button is released. However, I struggle to make an appropriate piece of code.
I managed to make it work with the code below added to the one of this project. Sadly, it includes another library, and it then shows up as a separate gamepad in windows. I could not figure out how to make it work using <HID.h> only. I am not too experienced in all that stuff though.


#include "HID-Project.h"
void setup() {
pinMode(BUTTON, INPUT_PULLUP);
Gamepad.begin();
}
void loop() {
gamepadTick();
}
void gamepadTick() {
if (millis() - timer > 10) {
timer = millis();
if (!digitalRead(BUTTON) Gamepad.press(1);
else Gamepad.release(1);
Gamepad.write();
}
}


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants