Go Back   PCMech Forums > General & Off Topic > General Discussion

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 04-04-2005, 06:03 AM   #1
Member (10 bit)
 
Designer's Avatar
 
Join Date: Mar 2004
Location: Essex, UK
Posts: 982
Send a message via AIM to Designer Send a message via MSN to Designer
I need some maths help guys

Hiya guys,

Little maths question for ya, if anyone can work this out then they deserve a medal, either that or it's just me being really thick again

A program i'm working on needs an analogue gauge and a digital representation of the gauges reading (which is gonna be in a text box under the gauge). The number being inputted ranges from 0-255 and if compared to the actual then input of 0 would give an output of -20, an input of 255 would give an output of +20 and an input of 126.5 would give an output of 0. I think i've explained that as best i can.

so input of 0 = screen reading of -20 and input of 255 = screen reading of +20.

Any ideas on the maths involved?
__________________
Intel Core i7 920 2.66GHz | Asus P6T SE| 6GB Corsair ram | XFX Radeon HD 4780 | 2 x 250 Gb Maxtor SATA II (in RAID 0), 1 x 250GB SATA II | Creative XFI soundcard | Coolermaster 650W PSU | ThermalTake Tsunami case

My new website -Carp Fishing Forums
Designer is offline   Reply With Quote
Old 04-04-2005, 07:05 AM   #2
Staff
Premium Member
 
rjfvillarosa's Avatar
 
Join Date: Sep 2004
Location: Cardiff, Wales. UK
Posts: 6,105
Where 0 = -20 and 255 = +20 every increment of 1 in the range 0 to 255 is equivalent to an increase in value of 0.15686 in the range -20 to +20
__________________
Niwa no niwa ni wa, niwa no niwatori wa niwaka ni wani o tabeta.
rjfvillarosa is offline   Reply With Quote
Old 04-04-2005, 07:17 AM   #3
Member (9 bit)
 
Join Date: Nov 2004
Location: Flint, MI
Posts: 256
Yes, rjfvillarosa is right. Each one between 0-255 would represent .15686 of whatever. By the time that you reached 255 it would virtually come out to 40, or the spread of -20 to 20.

^fo
foolishone is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:29 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2