I have a Daco MG13 control grip, 3 buttons and a HAT. I have it connected to a USB Shield, on an Arduino Uno R3 board.
I am a bit of a noob, but understand programming a bit.
I have spent weeks now trying to get this working, I must be missing the forest for the trees at this point.
An example of what I want to do is:
Pull and hold trigger, close circuit on pin X (will be used to activate a radio for communication on an aircraft)
Release trigger, open circuit
Easy enough I would have thought. If I can get this going, I'll be able to figure out all the rest of the buttons. I just can't figure out how to capture that trigger press and translate it into a "button press" over USB.
Any help would be appreciated, and without the lame go watch this Youtube video or read this Arduino doc (unless you have a good one, I haven't been able to find it).
Much appreciated for any help, I really just must be overly frustrated and can't see the solution.
Yeah, I have that too. My issue is that I can't figure out how to capture the button presses via the USB Shield. I am sure this is super easy, and I think I got the Uno to recognize the controller through the following as I get the "USB Host initialized" msg:
void setup() {
//Initialize serial interface
Serial.begin(115200);
if (Usb.Init() ==-1) {
Serial.println("Could not initialize USB Host.");
while(1);
}
else
{
Serial.println("USB Host initialized!");
}
My issue is after. My latest attempt looks like this:
void loop() {
Usb.Task();
//Read Joystick values
if (Serial.available()){
char input = Serial.read();
switch (input) {
case 'A0': //Left button
Serial.println("Left button");
break;
case 'A1': //Hat up
Serial.println("Left button");
break;
case 'A2': //Hat down
Serial.println("Left button");
break;
case 'A3': //Hat left
Serial.println("Left button");
break;
case 'A4': //Hat right
Serial.println("Left button");
break;
case 'A5': //Right button
Serial.println("Left button");
break;
case 'A6': //Trigger
Serial.println("Left button");
break;
}
}
}
I am thinking that USB is digital, so the serial won't work (or I have no clue what I am talking about)...
I feel this is so easy, and I'm going to bang my head when I get it, but...
Can you please post a link to data/specs of the control grip?
Also note that you are expecting the grip to communicate through the serial pins of the UNO that you are also serial printing to the IDE through those same pins.
Might be worth using the SoftwareSerial library and two other pins to communicate between the UNO and the grip.
Also note that you are expecting the grip to communicate through the serial pins of the UNO that you are also serial printing to the IDE through those same pins.
I take it you cannot do that? The grip is connected to a USB Shield that is installed on the Uno. I assumed there would be an easy plug n play way (library) to just connect, assign the buttons to pins (tell them what to do), and off I go.
Might be worth using the SoftwareSerial library and two other pins to communicate between the UNO and the grip.