Regis Monte
Member
Hello,
I've been working on teensy 4.1 for a year now and recently came into mind blowing troubles.
I have two teensy board that cannot read anologRead() anymore.
I started over with the basic tutorial as I was very confused, and it worked well until the analogInput() sketch. So it looks like it can digitalWrite(), digitalRead(), and analogWrite() but no more analogRead(). The input value is ever 8-12 or 1010-1014 and does not react to anything, even my fingers (which I used to use to make the value move a bit).
The audioBoard still works well with the ladder filter swipping in standalone mode.
The problem is very recent and occured on a first teensy 4.1, so I took one new as I thought I would have done something wrong with the previous one, but both do the same. I have tried a few previous settings of pinMode() also... I doubt you can reproduce this at home but if you have any clue on that ?
By the way, after spending hours trying to understand why I had a gap in analogRead() from around 495 to 550, even with averaging and precision settings, I found out that using digitalWrite(LOW) on the pin would resolve that (Thanks to the ResponsiveAnalogRead library which is definitly what we should use).
Thanks a lot.
I've been working on teensy 4.1 for a year now and recently came into mind blowing troubles.
I have two teensy board that cannot read anologRead() anymore.
I started over with the basic tutorial as I was very confused, and it worked well until the analogInput() sketch. So it looks like it can digitalWrite(), digitalRead(), and analogWrite() but no more analogRead(). The input value is ever 8-12 or 1010-1014 and does not react to anything, even my fingers (which I used to use to make the value move a bit).
The audioBoard still works well with the ladder filter swipping in standalone mode.
The problem is very recent and occured on a first teensy 4.1, so I took one new as I thought I would have done something wrong with the previous one, but both do the same. I have tried a few previous settings of pinMode() also... I doubt you can reproduce this at home but if you have any clue on that ?
Code:
int pin = 11;
int ledPin = 13;
void setup()
{
Serial.begin(38400);
pinMode(ledPin, OUTPUT);
//pinMode(pin, INPUT_PULLUP);
//digitalWrite(pin, HIGH);
}
void loop()
{
delay(100);
Serial.println("analog "+String(pin) + " is " + analogRead(pin) );
digitalWrite(ledPin, !digitalRead(ledPin));
}
By the way, after spending hours trying to understand why I had a gap in analogRead() from around 495 to 550, even with averaging and precision settings, I found out that using digitalWrite(LOW) on the pin would resolve that (Thanks to the ResponsiveAnalogRead library which is definitly what we should use).
Thanks a lot.