ArduinoJoystickLibrary icon indicating copy to clipboard operation
ArduinoJoystickLibrary copied to clipboard

Multiple Joystick Issue

Open errorflash opened this issue 1 year ago • 1 comments

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() {

}`

errorflash avatar Sep 23 '22 15:09 errorflash

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.

MHeironimus avatar Sep 23 '22 15:09 MHeironimus