Flowstone - Integer gain/reduce

This forum is for the discussion of topics relating to third-party software that uses Phidgets.
Asbjørn
Phidgetsian
Posts: 9
Joined: Fri Feb 19, 2010 6:09 pm
Contact:

Flowstone - Integer gain/reduce

Postby Asbjørn » Thu Sep 16, 2010 4:39 pm

I'm trying to control the position of a servo using the 1016 Circular Touch with the 1061 Advanced servo.

How do I convert the output integer from the circular touch (0-1000) to the range of the servo (-22.9921875 - 233)?

I tried the code primitive, but apparently that doesn't support integers.

Thanks.

Asbjørn
Phidgetsian
Posts: 9
Joined: Fri Feb 19, 2010 6:09 pm
Contact:

Re: Flowstone - Integer gain/reduce

Postby Asbjørn » Fri Sep 17, 2010 4:40 pm

Never mind, I found a solution.

DSPRobotics
Phidgetsian
Posts: 9
Joined: Wed Sep 08, 2010 11:44 am
Contact:

Re: Flowstone - Integer gain/reduce

Postby DSPRobotics » Sat Sep 18, 2010 3:29 pm

One way (for those interested) is to just connect the Integer out of the Phidgest Module in FlowStone to a Float multiply and multiply by a constant to get the range you need. If you need +/- then use a Float subtract etc.

Asbjørn
Phidgetsian
Posts: 9
Joined: Fri Feb 19, 2010 6:09 pm
Contact:

Re: Flowstone - Integer gain/reduce

Postby Asbjørn » Sat Sep 18, 2010 4:48 pm

Yup, that's almost what I did. I converted the output integer to a percentage, and then converted the percentage to the range the servo controller needed.

Really simple. :)


Return to “Third-Party Software”

Who is online

Users browsing this forum: No registered users and 2 guests