Skip to content

Commit 940cd3d

Browse files
committed
Make nunchuk support opt-in
1 parent 30d85f0 commit 940cd3d

2 files changed

Lines changed: 29 additions & 4 deletions

File tree

HayB0XX/HayB0XX.ino

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
HayB0XX Version 0.1.0
2+
HayB0XX Version 0.1.1
33
44
Some parts of this code were originally based on GCCPCB2 v1.208 code by Crane.
55
@@ -20,6 +20,8 @@
2020
#include "ProjectM.h"
2121
#include "src/NintendoExtensionCtrl/src/Nunchuk.h"
2222

23+
#define NUNCHUK_ENABLE false
24+
2325
enum reportState : byte {
2426
ReportOff = 0x30,
2527
ReportOn = 0x31,
@@ -100,8 +102,10 @@ void readInputs() {
100102
}
101103

102104
void setup() {
103-
gNunchuk.begin();
104-
gNunchuk.connect();
105+
if (NUNCHUK_ENABLE) {
106+
gNunchuk.begin();
107+
gNunchuk.connect();
108+
}
105109

106110
pinMode(pinout::L, INPUT_PULLUP);
107111
pinMode(pinout::LEFT, INPUT_PULLUP);
@@ -126,7 +130,7 @@ void setup() {
126130
pinMode(pinout::LIGHTSHIELD, INPUT_PULLUP);
127131
pinMode(pinout::MIDSHIELD, INPUT_PULLUP);
128132

129-
// Read inputs into gInputState initially to make backend selection logic in
133+
// Read initial inputs into gInputState to make backend selection logic in
130134
// initialise() a bit cleaner.
131135
readInputs();
132136

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Features include:
3939
* [Creating custom input modes](#creating-custom-input-modes)
4040
* [Mod X lightshield and R shield tilt](#mod-x-lightshield-and-r-shield-tilt)
4141
* [Project M/Project+ mode](#project-mproject-mode)
42+
* [Enable Nunchuk support](#enable-nunchuk-support)
4243
* [Troubleshooting](#troubleshooting)
4344
* [Contributing](#contributing)
4445
* [Contributors](#contributors)
@@ -295,9 +296,29 @@ can press Mod X + Z to send a true Z input.
295296
If this bothers you, and you just want to send a true Z input by default when
296297
pressing Z, you can set the `trueZPress` parameter to true.
297298

299+
### Enable Nunchuk support
300+
301+
Nunchuk support is disabled by default as it can cause a number of issues if the
302+
i2c pins (pin 2 and 3 on Arduino Leonardo) are used for GPIO. To enable it, find
303+
the line `#define NUNCHUK_ENABLE false` at the top of HayB0XX.ino and change it
304+
to `true`.
305+
298306
## Troubleshooting
299307

308+
### Controller not working with console or GameCube adapter
309+
310+
- Make sure you are holding C-Down on plugin (if using default bindings).
311+
- If you are using an official adapter you will likely have to disable the
312+
polling latency optimisation by passing in a polling rate of 0 to the
313+
GamecubeBackend constructor.
314+
- If using pins 2 or 3 for your GameCube circuit, make sure Nunchuk support is
315+
disabled
316+
317+
### Joystick.h, nintendo.h, arduino_vector.h, and keyboard.h files are missing
300318

319+
If the libraries are missing it's because you didn't download the release
320+
correctly. Do not click "download repo as zip" or "download source". Download
321+
the latest release artifact from the releases page.
301322

302323
## Contributing
303324

0 commit comments

Comments
 (0)