I'm working on a flight sim joystick using the joystick.h library. I've gotten 7 pots initialized and working correctly, x,y,z,rx,ry,rz,rudder, however when i initialize the 8th pot throttle. rudder dissapears and no longer works. is there a limit to how many pots joystick can use? the micro should have 12 analog inputs so i was hoping to use 9 pots for flight surfaces and 3 switches for various other needs
//REVIEW ALL TABS FOR INFORMATION ABOUT WIRING AND COMPLETE BUILD GUIDE!!!
#include <Keypad.h>
#include <Joystick.h>
//Potentiometer Setup
Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID,JOYSTICK_TYPE_JOYSTICK,
0, 0, // Button Count, Hat Switch Count
true, true, true, // X, Y, and Z Axis
true, true, true, // Rx, but no Ry or Rz (Rx represents throttle as fs2020 does not recognize the throttle axis!)
true, true, // No rudder or throttle (represented as Rx!)
false, false, false); // No accelerator, brake, or steering;
int XAxis = 0;
int YAxis = 0;
int ZAxis = 0;
int RxAxis = 0;
int RyAxis = 0;
int RzAxis = 0;
int Rudder = 0;
int Throttle = 0;
void setup(){
Joystick.begin(); //Starts joystick
}
void loop(){
XAxis = analogRead(A0);
XAxis = map(XAxis,0,1023,0,255);
Joystick.setXAxis(XAxis);
YAxis = analogRead(A1);
YAxis = map(YAxis,0,1023,0,255);
Joystick.setYAxis(YAxis);
ZAxis = analogRead(A2);
ZAxis = map(ZAxis,0,1023,0,255);
Joystick.setZAxis(ZAxis);
RxAxis = analogRead(A3);
RxAxis = map(RxAxis,0,1023,0,255);
Joystick.setRxAxis(RxAxis);
RyAxis = analogRead(A4);
RyAxis = map(RyAxis,0,1023,0,255);
Joystick.setRyAxis(RyAxis);
RzAxis = analogRead(A5);
RzAxis = map(RzAxis,0,1023,0,255);
Joystick.setRzAxis(RzAxis);
Rudder = analogRead(A6);
Rudder = map(Rudder,0,1023,0,255);
Joystick.setRudder(Rudder);
Throttle = analogRead(A7);
Throttle = map(Throttle,0,1023,0,255);
Joystick.setThrottle(Throttle);
delay(5);
}