I'm trying to make a flight sim yoke with rudder and other controls. i can get one pot to work i have loaded the CadetThrottle_Code by vince_prints and can see the mot moving in set up usb game controller. however when i plug in a second pot to the power and ground rail of the breadboard the micro turns off. i have checked that the 2 ends of the pot read nominal impedence with a dmm indicating they are positive and ground ends
Welcome.
You might want to provide a few more details of your project if you want help from the forum members.
You need to tell us which Arduino you are using and how you have wired up your pots. A simple hand drawn schematic will do.
Also, you should post the code you are using using code tags, but please read the forum guidelines first to make sure you post your code correctly.
Do you know the pot’s resistance?
Are you connecting the center pin to ground or Vcc by mistake?
That would be my guess. If the wiper and one ground/power connection are reversed, one extreme of the pot will place a direct short between power and ground, killing the supply.
Realize, we can't see any of your stuff and we don't even have pictures or diagrams of it.
Please read the document you were asked to read when you signed up.
my apologies. i had them wired to rs not 5v
Sorry, what is "rs"?
Hey guys I'm trying to make a flight Sim controller. I'm running code based off this
I have changed it to use all analog inputs A0 - A8. However I can only get 4 pots to work correctly. Somehow after 3 pots are used in x,y,z they all get read as z axis. I can move the wire from A4 reading z axis move it to A6 and it still reads z axis and not brake or throttle
Please read the forum guidelines to see how to properly ask a question and some good information on making a good post.
Screenshots of the code is completely useless, please insert the code as text using the code tags.
I just seen that it is your second post regarding to the same subject. Cross-posting is vialation of the forum rules. Please continue the discussion on the first topic, this one will closed soon.
Just a guess at what you are trying to do. Have you thought about maybe using rotary encoders instead of pots?
Can I post a picture of my answer?
I have merged your 2 topics that clearly relate to similar problems with the same project. In your first topic you were directed to the forum instructions, which you obviously have not read. If you want people to be helpful I suggest you stop and read the instructions now, before posting anything else. Then post the requested information.
Thank you.
its a reset pin i guess the pinout diagram has ground reset and 5v
//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, false, false, // 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!)
true, true, false); // No accelerator, brake, or steering;
int throttle = 0;
int fuel = 0;
int pitch = 0;
int roll = 0;
int rudder = 0;
int trim = 0;
int L_brake = 0;
int R_Brake = 0;
int flaps = 0;
void setup(){
Joystick.begin(); //Starts joystick
}
void loop(){
throttle = analogRead(A0);
throttle = map(throttle,0,1023,0,255);
Joystick.setRxAxis(throttle);
fuel = analogRead(A1);
fuel = map(fuel,0,1023,0,255);
Joystick.setXAxis(fuel);
pitch = analogRead(A2);
pitch = map(pitch,0,1023,0,255);
Joystick.setYAxis(pitch);
roll = analogRead(A3);
roll = map(roll,0,1023,0,255);
Joystick.setYAxis(roll);
rudder = analogRead(A4);
rudder = map(rudder,0,1023,0,255);
Joystick.setYAxis(pitch);
trim = analogRead(A5);
trim = map(trim,0,1023,0,255);
Joystick.setYAxis(pitch);
L_brake = analogRead(A6);
L_brake = map(L_brake,0,1023,0,255);
Joystick.setYAxis(L_brake);
R_Brake = analogRead(A7);
R_Brake = map(R_Brake,0,1023,0,255);
Joystick.setYAxis(R_Brake);
flaps = analogRead(A8);
flaps = map(flaps,0,1023,0,255);
Joystick.setZAxis(flaps);
delay(5);
}
pots measure right around 10k ohms
We need to see a schematic of your project.
i apologize for the problems ive caused. i found it to be a code issue. i was not changing the joystick.set line properly. i have gotten up to 7 pots working. but now when i try to add an 8th i loose one. so if i have the rudder as the 7th joystick and add the throttle while keeping the z,y,x,rz,ry,rx axes i loose the rudder axis but get the throttle axis. is the limit to pot axis 7?
Great! I recon you create a new thread for that to keep this one clean.
Please lose this topic (select the Solution button on your last post)
@scott208, do not cross-post. Thread locked.