10K Pot problem - (Arduino Experimentation Kit - ARDX)

For makers who have purchased an Adafruit Starter Pack, get help with the tutorials here!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
perrigo
 
Posts: 2
Joined: Fri Jul 03, 2009 2:00 pm

10K Pot problem - (Arduino Experimentation Kit - ARDX)

Post by perrigo »

I ordered the new arduino experimentation kit last week and my potentiometer doesn't appear to be working correctly. When I have the arduino print the values being read the minimum value is 290 and the max is 315. Did I get a defective pot?

Just for reference here's the sample code I'm using. I'm using one of the sample circuits provided with the kit and this is the sample modified to print the values. I did this because I couldn't get the sample circuit to work.

Code: Select all


 int potPin = 2;    // select the input pin for the potentiometer
 int ledPin = 9;   // select the pin for the LED
 int val = 0;       // variable to store the value coming from the sensor

 void setup() {
  pinMode(ledPin, OUTPUT);  // declare the ledPin as an OUTPUT
  Serial.begin(9600);
 }

 void loop() {
  int threshold = 512;
  val = analogRead(potPin);    // read the value from the sensor
   analogWrite(ledPin, val);  // turn the ledPin on
  Serial.println(val);
 }

mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am

Re: 10K Pot problem - (Arduino Experimentation Kit - ARDX)

Post by mtbf0 »

well lit, in focus photo straight down at the circuit is always helpful. sometimes helps to difuse the flash with a piece of tissue.

perrigo
 
Posts: 2
Joined: Fri Jul 03, 2009 2:00 pm

Re: 10K Pot problem - (Arduino Experimentation Kit - ARDX)

Post by perrigo »

Nevermind. It was a noob mistake. I was trying to read from the digital pin instead of analog. Thanks for the interest.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Starter Pack”