Shop OBEX P1 Docs P2 Docs Learn Events
Scaling a pot for RC time measurement?? — Parallax Forums

Scaling a pot for RC time measurement??

Brian218Brian218 Posts: 92
edited 2009-10-25 18:28 in Propeller 1
Hi,

Could someone explain, post some spin code, or post a link, that explains how to scale a pot for RC Time measurement?

I did a forum search, but wasn't able to find anything.(might be me)

Here is exactly what I'm trying to do:

I'm reading a 10K pot and a .01mF cap in-order to adjust the duty cycle for a PWM.
With my current set up, the potentiometer can be adjusted from 0 to 5100 and I'm trying to scale the pot so it can be adjusted from 0 to 100. The value from the pot will determine the duty cycle for the PWM

Thanks in advance,

B-

jumpin.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
This post is a work of art. Variations in spelling and grammar are intentional, artistic endeavors that add value to all of mankind.

Comments

  • T ChapT Chap Posts: 4,223
    edited 2009-10-25 11:12
    Try dividing the value you are already getting by 51 and see if it gets you close enough. You could also set up a Case statement, with 100 options.

    Post Edited (Todd Chapman) : 10/25/2009 11:17:17 AM GMT
  • Brian218Brian218 Posts: 92
    edited 2009-10-25 18:28
    Thanks Todd,

    That worked perfectly!

    Thanks again
    B-

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    This post is a work of art. Variations in spelling and grammar are intentional, artistic endeavors that add value to all of mankind.
Sign In or Register to comment.