I have a wireless gamepad from DF Robotics (Wireless GamePad V2.0 for Arduino - DFRobot), two XBee Pro S1, an Arduino Mega, a Raspberry Pi 3, a Mac, and am running Arduino IDE 1.8.2 although I also have the older IDE 1.0.5 I also have XCTU 6.3.5
Using the Arduino IDE, I have successfully loaded sketches onto the gamepad, and have a serial string in the serial monitor telling me the buttons being pushed, and the values of the joysticks. That sketch is found here: Wirless_GamePad_V2.0__SKU_DFR0182_-DFRobot
I have also read and tried to use this amazing tutorial found here:
The problem is that I have XBees and not the Bluetooth module ones used in the tutorial and do not know how to modify for that.
I have linked the XBees using the XCTU and the Arduino monitor and got them to chat with each other using software serial although I could not figure out how to get a new line or a ‘carriage return’ when going from the XCTU to the Arduino. (For anyone facing challenges here, I lost a day figuring out that for some reason software.serial does not work on pins 2 and 3 on the Mega and that pins 10 and 11 had to be used. Also, some sketches listed serial1.print instead of serial.print)
I also have a Raspberry Pi 3 and hope to include it in a project. For motor interfacing, I have an Adafruit Motor shield, and some Sabertooth modules from Dimension Engineering. (They are the best!) The end project will drive DC motors for the motive power, and probably steppers for the arm control.
What I would like to do is program the gamepad controller to use it to control (via a Raspberry Pi and Arduino Mega) a mobile platform with a robotic PID stabilized robotic arm. I would also like to be able to connect it to my 3Axis Gimbal as shown in the tutorial above. I would like that platform to return basic telemetry status and be path programmable.
Although I am confident with the hardware side, programming is new to me, and being able to load up some sketches if a far cry from programming them, although I have been studying the programming side. To be honest it makes me feel stupid and is frustrating. But I love the moments of understanding. I have tried unsuccessfully to combine sketches, and am still having problems doing so, especially if it includes the XBee’s.
What I am looking for to start is a suitable sketch for the gamepad which includes the XBees and then a matching sketch for the Arduino which drives the steppers and motors through the shields and Sabertooths. I have no idea how to take the existing sketch operating in the gamepad and transmit it via the XBee to the other one, let alone then change that information into something which can control the motor shields and Sabertooth modules. I do know how to control them with a pot attached to the board directly, and with my RC Transmitter, and have been experimenting with sending serial packets to control the Sabertooths.
I would also like to modify the sketch for the gamepad and gimbal so that I can do what it does with the Bee Pro instead of the XBee Bluetooth.
I am looking for partners/collaborators and Mentors who can help me understand programming and building the sketches. Or any help on modifying the gamepad sketch so that I can use the Bee modules I have. That would be awesome. Actually, any help at all would be much appreciated. Thank you for your time!