Shop OBEX P1 Docs P2 Docs Learn Events
potentiometer mathematics — Parallax Forums

potentiometer mathematics

RobbanRobban Posts: 124
edited 2008-02-07 17:48 in BASIC Stamp
Hi

i have a potentiometer from Parallax and when the pot. is at position 0 then the result is 0 and when the pot is at max the result is 65500

i wonder now how i calculate to get the result to show
0 then result is 0 and 10 then the result is 65500

formula?

/Robban

Comments

  • Tracy AllenTracy Allen Posts: 6,666
    edited 2008-02-07 17:48
    How is the potentiometer hooked up to the Stamp? That could change the answer.

    Simple answer:

    answer = result / 6550
    answer=0 when result=0
    answer=10 when result=65500

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.