View Single Post
  #1   Spotlight this post!  
Unread 15-01-2007, 19:39
teh_pwnerer795 teh_pwnerer795 is offline
Registered User
AKA: !!Mitch!!
FRC #1392
Team Role: Programmer
 
Join Date: Nov 2006
Rookie Year: 2006
Location: Ajax, Canada
Posts: 142
teh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really nice
Send a message via MSN to teh_pwnerer795 Send a message via Yahoo to teh_pwnerer795
Floating Points and rounding

Hey guys,

for the camera this year, i'd like to set the PAN and TILT values into degrees. Now im sure there is code already formulated somewhere within kevin code. but i'd rather wrap my mind around how to properly do it.

This is my code so far.

//(1.42 degree) per (1pwm)
PAN_DEGREE = (180 / 127);
True_PAN_Degree = PAN_DEGREE * PAN_SERVO;

Now. my question to u guys. i want to use floating points instead of intergers. i would also like to noe how to round the floating point number to 4 decimals. However. i do know that floating points do take alot of space and processing power! but! the maximum value being produced is 180. ( 180 degrees). If you could leave some input that would be great
__________________
Great Art is Created; Master Pieces are Stolen

[n00b]Teh_Foxdonut teh_pwnerer795 - CounterStrike:Source