help

ok i got the code done but instead of a button i used the switch case function with a potentiometer (which i don't have right now) but i have one of this
http://www.kpsec.freeuk.com/photos/rapid/preset3.jpg
how do i set this up to work like a potentiometer the three pins got me a little mixed up and i don't know what to do.