Shop OBEX P1 Docs P2 Docs Learn Events
Use of a poteniometer with Bs2 or bs2e — Parallax Forums

Use of a poteniometer with Bs2 or bs2e

christian_hahn13christian_hahn13 Posts: 30
edited 2006-01-30 06:01 in General Discussion
I was wondering how to use a potentiometer with my basic stamp.
Any replies are very much apprectiated.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-29 05:08
    The RCTIME command in the manual and online help file will show you the way. Type RCTIME in the editor, double-click on it to highlight, then press the [noparse][[/noparse]F1] key.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • christian_hahn13christian_hahn13 Posts: 30
    edited 2006-01-29 05:43
    i'm sort of confused on the use of rctime in my case, what i need is the exact location of the dial. The reason this is because i have a potentiometer attack directly to a motor and this will tell me exactly where the motor is.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Clock LoopClock Loop Posts: 2,069
    edited 2006-01-29 06:55
    Mabee you should consider making the bs2 read the potentiometer, and then the bs2 controll the motor. so its not only reads the potentio meter, but also controlls the motor based on the potentio reading.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Meh. Nothing here, move along.
  • christian_hahn13christian_hahn13 Posts: 30
    edited 2006-01-29 08:34
    that's what i had in mind
    -Thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-01-29 10:24
    You still need to you the RCTIME function.

    Basically, the Capacitor is charged and then the BasicStamp counts how long it takes to discharge.

    The Resistor in the form of a potentiometer will change the rate at which the Capacitor discharges and this will give you a number that corresponds to the position of the potentiometer.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • christian_hahn13christian_hahn13 Posts: 30
    edited 2006-01-29 10:45
    Thanks alot for the explanation

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • christian_hahn13christian_hahn13 Posts: 30
    edited 2006-01-29 10:46
    which capacitor would be best to use, talkin about uF measurements

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-01-29 15:37
    You could use the LTC1298 analog-to-digital converter (ADC).· Parallax sells them.· [noparse][[/noparse]Basic concept picture attached.]
    456 x 330 - 24K
  • Clock LoopClock Loop Posts: 2,069
    edited 2006-01-29 16:09
    christian_hahn13 said...
    which capacitor would be best to use, talkin about uF measurements

    The BEST way for you to go, is open the help file for the stamp program editor. A.K.A the "Pbasic syntax guide", and look up
    command RCTIME.

    It gives you an example of using RCTIME with a potentiometer. Along with a schematic.

    I don't really think you would need an extra chip just to read a potentiometer, unless you wanted EXACT results. Even then you can program a small filter program that will act like a ADC converter, in program code.

    Good luck.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Meh. Nothing here, move along.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-01-30 06:01
    It never hurts to read the BasicStamp Manual. I find that it actually is much more of a teaching textbook that a programing reference.

    I think a lot of us forget that it is extremely useful and has tons of schematics with clear explanations. It happens to be the Bible that made Parallax a sucess.

    Use it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Sign In or Register to comment.