Hello guys!
So, I'm having some problems with my analog pins on a project I'm working on
I'm trying to adapt an G27 shifter to usb using the Nano (I know it's limitations due to not having the HID capabilities, but I want to try doing this, even without those capabilities)
So, i'm with an db9 port connected to my arduino, with the following wiring diagram:
I've made a connection to the Y axis of the shifter to an digital pin, which is actually working fine, but it's not of much use to what I need, which is an analog value.
The analog port, when using the analogRead is always returning it's max value, 4095, which is a problem.
here's the code, which is just for checking the value on those ports:
int analogPin = A3;
int val = 0;
int pushButton = 5;
void setup() {
Serial.begin(9600);
pinMode(A3, INPUT);
pinMode(pushButton, INPUT);
}
void loop() {
int buttonState = digitalRead(pushButton);
Serial.println(buttonState);
delay(500);
val = analogRead(analogPin);
Serial.println(val);
delay(500);
}
So, I really need some help on this.
I even don't know certainly if each gear will return a different value, but I'm really looking forward to give it a try on this.
(if you have an tip on how to translate the digital sign to something I can use to identify which gear is it, or anything else, please, feel free to comment!)
oh, should have clarified that on the post, sorry lol
So, the G27 is a logitech gaming wheel, and I'm trying to connect it's shifter to the Nano
If i'm not mistaken, the shifter uses potentiometers, but I couldn't find a internal diagram.
If you have a voltmeter you could measure an analog voltage - if there is one.
Maybe the analog output/s of this shifter have to be pulled up (try a 10kΩ resistor) - they may be variable resistances.
hey, measuring the voltage between the analog pin and the ground, it's a 5v voltage
about the analog outputs being needed to be pulled up, I really don't think that's the case, this wiring diagram is based on a similar project which uses the pro micro, and the analog outputs didn't needed that.
well, I think the variation is there, because the digital pin on Nano that it's connected to the shifter Y axis, it's actually recognizing when there's a variation, and I need this similar thing on the analog pin, like it happens in the similar project with micro
here's the project for reference: GitHub - n-e-y-s/G27_Pedals_and_Shifter at n-e-y-s_devel
Also, I just measured the voltage between the gorund and the analog pin, and It was to be exact, it's a 4,56v
ok, so
when moving the shifter in the X axis to the left, the voltage changes to 4,55v and to the right, 4,57v
so, there's variance, but a really little one
This happens on the Y axis on the digital pin too, but the voltage variance it's much bigger, almost 2 voltages when it varies
You noted a maybe 20mV difference. So that's not happening.
What if you pull it down with a 10kΩ resistor (that is, to GND)?
I don't want to put too fine a point on this - but there should be some 'broad' range of voltages to analogRead or that isn't going to work.
(So, if not - Why not?)
sure, why not
I could try to pull it down for sure, I'm just not very familiar with it, where should I put this 10kΩ resistor ?
and just to clarify, the resistor will get my voltage near to 0v, so that the variance of 20mV can be read ? or the variance will be higher with the resistor ?
(btw, thanks for the help already)