Hi everyone.
I'm currently having issues reading correct analog values using TeensyLC.
My aim is to read pots values from a joystick. For X axis for instance, center resistance is 5.5kohm, leftmost is 3.5kohm, rightmost 7.5kohm. The resistance is thus very linear.
Problems occurs when reading analog from the teensy, using this code:
Still for the X axis, the center values is around 56, leftmost around 5 and rightmost around 750! It's as if the pot was logarithmic...
I feel I'm missing something obvious, but I really can't see what...
I'm currently having issues reading correct analog values using TeensyLC.
My aim is to read pots values from a joystick. For X axis for instance, center resistance is 5.5kohm, leftmost is 3.5kohm, rightmost 7.5kohm. The resistance is thus very linear.
Problems occurs when reading analog from the teensy, using this code:
Code:
#include <ResponsiveAnalogRead.h>
ResponsiveAnalogRead analog(A8, true);
void setup() {
Serial.begin(38400);
}
void loop() {
analog.update();
int aa = analog.getValue();
Serial.println(aa);
delay(20);
}
Still for the X axis, the center values is around 56, leftmost around 5 and rightmost around 750! It's as if the pot was logarithmic...
I feel I'm missing something obvious, but I really can't see what...