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

[Question] Digital inputs #68

Open
ChrisCrashX opened this issue Aug 6, 2024 · 1 comment
Open

[Question] Digital inputs #68

ChrisCrashX opened this issue Aug 6, 2024 · 1 comment

Comments

@ChrisCrashX
Copy link

I have been trying to make a bot to put basic inputs into a Gamecube, without for the need of a Gamecube controller. Basically I want to assign my Arduino a set of buttons to press and depress, but I just can't figure out how. I have tried a bunch of different things with no success. Is there any way you could lead me in the right direction?

Here is what I have so far:
#include "Nintendo.h"

const byte pin = 8;
CGamecubeConsole GamecubeConsole(pin);
Gamecube_Data_t d = defaultGamecubeData;

void setup()
{

}

void loop()
{
int A = 0;
int B = 0;
int X = 0;
int Y = 0;
int Start = 0;
int Up = 0;
int Down = 0;
int Left = 0;
int Right = 0;
int Z = 0;
int R = 0;
int L = 0;

//reports data
d.report.a = A;
d.report.b = B;
d.report.x = X;
d.report.y = Y;
d.report.z = Z;
d.report.start = Start;
d.report.r = R;
d.report.l = L;
d.report.dup = Up;
d.report.dright = Right;
d.report.ddown = Down;
d.report.dleft = Left;

//sends the complied data to console when console polls for the input
GamecubeConsole.write(d);
}

@andrew171717
Copy link

It's probably a timing issue with how frequently you are writing inputs. You could try either doing multiple writes at the end instead of one call or adding a very slight delay after the write, probably less than a few milliseconds.

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