Go to Post Tinkerer math = engineer - MikeE [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Spotlight this post!  
Unread 06-02-2009, 21:05
3DWolf's Avatar
3DWolf 3DWolf is offline
Boots - Head Programmer / 3D
AKA: Jake
FRC #1502 (Technical Difficulties)
Team Role: Programmer
 
Join Date: Dec 2006
Rookie Year: 2005
Location: Chelsea Michigan
Posts: 97
3DWolf is on a distinguished road
Send a message via AIM to 3DWolf Send a message via MSN to 3DWolf
Re: How to Program a Servo

Quote:
Originally Posted by byteit101 View Post
it is 0 to 1 not -1 to 1
Oh, right. Most of the other functions are -1 to 1, didn't look at the docs.
If you need to scale (-1, 1) to (0, 1) you can use
prevVal = joystick(1)->Get(); //-1 to 1 value
ScaledVal = (prevVal + 1)/2; //Scaled to 0 to 1
__________________
You can call it the programming teams fault, but we'll just force your arguments nil.

There are 10 kinds of people in the world -> Those who understand binary and those who don't.

WYSIWYG - In FIRST: Greatness
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Program a Servo? programmr Programming 5 10-02-2008 13:12
How to conect solenoids to the circuit board. and how to program it...??? arpitshah Pneumatics 6 13-01-2008 15:06
Servo Values to Degrees... How? mogunus Programming 16 11-04-2007 02:03
How much do the servo cost? Ken Leung Motors 2 14-09-2001 15:42


All times are GMT -5. The time now is 13:16.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi