ArduinoJoystickLibrary
ArduinoJoystickLibrary copied to clipboard
Multiple Joystick Issue
Is it possible to get an easy example (not the test example) ??
eg.:
Joystick A........... Joystick B...........
Buttons........
Analag IN A........ Analog IN B.......
I have no big brain in Programming and i don`t understand the Test code for own Projects.
Thanks for help!
`/* Bagger Joysticks 1.0 */
#include <Joystick.h>
Joystick_ {joystick1(0x04, JOYSTICK_TYPE_JOYSTICK, 3, 0, true, true, false, false, false, false, false, false, false, false, false)}; Joystick_ {joystick2(0x03, JOYSTICK_TYPE_JOYSTICK, 3, 0, true, true, false, false, false, false, false, false, false, false, false)};
const int pinToButtonMap = 2;
void setup(){
joystick1.setXAxisRange(-127, 127);
joystick1.setYAxisRange(-127, 127);
joystick2.setXAxisRange(-127, 127);
joystick2.setYAxisRange(-127, 127);
joystick1.begin();
joystick2.begin();
pinMode(2, INPUT_PULLUP); pinMode(3, INPUT_PULLUP); pinMode(4, INPUT_PULLUP); pinMode(5, INPUT_PULLUP); pinMode(6, INPUT_PULLUP); pinMode(7, INPUT_PULLUP);
const int pinToButtonMap = 2; } void loop() {
}`
I believe the GamepadExample or the FunduinoJoystickShield examples that are provided with the library are what you are looking for. You can also check out http://mheironimus.blogspot.com/2022/07/simple-arduino-leonardo-usb-game-pad.html?m=1.