Good morning. I have made a simple bluetooth joystick for AgOpenGps which emulates keyboard to send commands to AOG.
I have used the sketch for emulating keyboard with esp32 from Manuel BL, you can find all the info and the sketch he has made here ESP32 as Bluetooth Keyboard · GitHub.
It is very easy to setup, you only have to connect buttons PINS - to - GND of your esp32, without any resistors because my sketch use the internal resistor of the esp32.
COMMANDS LIST:
a = activate autosteer
t = Move line to the LEFT
y = Move line to the RIGTH
p = Snap line to the CENTER
o = Change AB Lines
m = Activate Manual Sections
g = Flag a Point
AOG has to be in full screen mode for moving line.
I had to add “t” “y” “o” shortcuts to AOG, for this reason you have to use my “modified” version of AOG 4.3.10. It is identical to the official ad it works the same.
All the files are here AOG_ESP32_BLUETOOTH - Google Drive
if you want to add your custom shortcut you have to compile your own version of AOG and modify the code in ProcessCmdKey. Open the source code of AOG and search ProcessCmdKey.
Once there you should use this type of code:
if (keyData == (Keys.???)) // Full Screen click
{
snapRightBigStrip.PerformClick(); // here you have to find the command you want to perform
return true; // indicate that you handled this keystroke
}
i hope can be usefull. Thanks to Daniel P from international telegram group.