Connecting Potentiometer with Sanguino board

Hi guys.I have a Sanguino Board.I wanted to connect a Potentiometer with the Sanguino board and read the values ( using analogRead() ), while changing its resistance.The following link tells how to connect an Arduino Board.

But I tried in the similar way in my Sanguino Board and only noticed that it took random values.So please help me out.Also tell the pins to which I need to connect the Potentiometer.

What size pot are you using? Resistance values above 10K may require longer measurement times and also produce larger errors.

The value shouldn't be random. If you turn the pot all the way CW and CCW do you
get a repeatable reading? Is the value random only while you are turning it?

(* jcl *)


www: http://www.wiblocks.com
twitter: http://twitter.com/wiblocks
blog: http://luciani.org

I used a 10k wire wound pot.The values are random even if I dont turn the pot.Even if I turn the pot all the way CW and CCW,Istill get random values.

Sounds like the pin is floating (nothing is attached). Are you sure you've got it all wired correctly and the potentiometer functions?

Also, are you reading the correct Analog pin?

"wired correctly" means +5 going to an outside pin of the pot, ground going to the other outside pin and the center pin going to the analog in

Guys now its working.I initialized the analog pin as INPUT in the "setup()".So it acted as a digital pin.An analog pin should not be declared as INPUT or OUTPUT in the "setup()".I corrected that and now its working fine