Forum Rule: Always post complete source code & details to reproduce any issue!
-
analogRead() not returning any values
hello, I am struggling to essentially just return any values with the analogRead() function. I have attached a 10k potentiometer to 3.3v and ground. When I print the values to the console all I see is 7 and 8 streaming in constantly. I was curious if I had a faulty potentiometer so I attached the 3.3v directly into analogPin 14, again with the same results. I will post my code below but it is extremely simple. I am using a teensy 4.1. If anybody has any suggestions I would love to hear them!
Code:
void setup() {
}
void loop() {
Serial.println(analogRead(A14));
}
-
Senior Member
Any chance the pot may be connected to the wrong pin? A14 is pin 38, right above the 5 pins that run across the middle of the board.
-
Haha well if I've learned anything today it's that I need glasses. Thanks for the help, its up and running!
-
Senior Member
Glad it's working now.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules