This could be something simple or stupid even, I’m by no means experienced with Arduino programming or hardware. With that I’d appreciate examples with insights or suggestions if it’s more advanced code.
I’m using MegaJoyArduinoSample.ino sktech that came with Megajoy, all of that is working perfectly fine. I have my joysticks in windows so base Megajoy functionality is fine.
I’m hoping I can get a little help with a issue i’m having with addition I’ve made to sketch.
I’m trying to activate joystick button based on specific ranges of values form analog A6 and A7 pins. These pins are x and y axis on second joystick in windows (standard Megajoy).
My sketch is kind of working, i used “Ifs” to bring corresponding digital input LOW when target A6, and A7 values are reached. Problem is that the button activation has a ~5 second delay.
Puzzling part of all this, is that I have a “else” in there which resets the digital inputs HIGH when A6 and A7 are outside of specified ranges, that part works instantly.
I attached the sketch and library file.
MegaJoy.h (9.36 KB)
Shifter_Adaptor.ino (2.53 KB)