Robirobisson
Member
Hey everyone. I have a project where I am using multiple pots as input controller with analogRead(). This was working fine since over a year. Suddenly one pot stopped working and analogRead() was returning a steady value of 1022.
So I changed the hardware pot, but this didn't fixed it.
Now I got rid of all the hardware and tested the Teensy 4.0 I am using on its own with this very simple sketch:
No change if I connect the pin 18 to ground (or 3.3V) pin. The value is always 1022. I also tried without the "INPUT_DISABLE" code in the setup() function, this was just to be sure nothing is influencing the analogRead() call.
All the other (analog) pins seem to work as expected -> 0 if connected to GND and 1023 if connected to 3.3V.
What could cause this? Maybe a broken ADC? Did someone already experienced something like this this? And if the ADC is broken, what could caused this?
Best,
Rob
So I changed the hardware pot, but this didn't fixed it.
Now I got rid of all the hardware and tested the Teensy 4.0 I am using on its own with this very simple sketch:
Code:
void setup() {
Serial.println("Test Sketch");
pinMode(A0, INPUT_DISABLE);
pinMode(A1, INPUT_DISABLE);
pinMode(A2, INPUT_DISABLE);
pinMode(A3, INPUT_DISABLE);
pinMode(A5, INPUT_DISABLE);
pinMode(A6, INPUT_DISABLE);
pinMode(A7, INPUT_DISABLE);
pinMode(A8, INPUT_DISABLE);
pinMode(A9, INPUT_DISABLE);
pinMode(A10, INPUT_DISABLE);
pinMode(A11, INPUT_DISABLE);
pinMode(A12, INPUT_DISABLE);
pinMode(A13, INPUT_DISABLE);
}
void loop() {
Serial.println(analogRead(A4));
}
No change if I connect the pin 18 to ground (or 3.3V) pin. The value is always 1022. I also tried without the "INPUT_DISABLE" code in the setup() function, this was just to be sure nothing is influencing the analogRead() call.
All the other (analog) pins seem to work as expected -> 0 if connected to GND and 1023 if connected to 3.3V.
What could cause this? Maybe a broken ADC? Did someone already experienced something like this this? And if the ADC is broken, what could caused this?
Best,
Rob