Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

MATH PROBLEM 1

Status
Not open for further replies.

DANTHEELECTRICMAN

Electrical
May 24, 2013
14
OK, I HAVE HAD A LOT OF THESE MATH PROBLEMS AND AFTER I PULL A FEW HAIRS OUT I HAVE MY ANSWER. WELL THIS TIME I HAVE A BRAIN FART,STILL NO ANSWER...IF SOMEONE HAS A FORMULA FOR THIS ONE,A MILLION THANKS...I HAVE A SENSOR THE OUT PUT ADC VALUE IS FROM 574(LOW END) TO 634(HIGH END),OK THAT IS FINE. I NEED TO DISPLAY 30(LOW END TO 50(HIGH END). THE TIME BEFORE THIS I WENT FROM 0(LOW END) TO 100(HIGH END),NO PROBLEM..IS ANY MULTIPLIER OR DIVISOR GOING TO SOLVE THIS PROBLEM...
 
Replies continue below

Recommended for you

1. Subtract the offset (574) from the ADC output.
2. Scale for the difference in span (634-574) and (50-30).
3. Add the display offset (30).
4. Display the result.


Mike Halloran
Pembroke Pines, FL, USA
 
OK MY OUTPUT IS 574 TO 634 FROM A 10BIT ADC,ONLY USING A SMALL DIFFERENCE OF THE FULL SCALE FROM 0 TO 1024...I CAN GET MY ANSWER FROM 574 TO 634 TO BE FROM 0 TO 100...STILL NOT FROM 30 TO 50..
 
If you can get a 0...100 number, then just
divide it by 5 and then
add 30.



Mike Halloran
Pembroke Pines, FL, USA
 
WELL MY FRIEND YOU DID IT.....AFTER THREE HOURS MY UNIT IS RUNNING FINE ( FOR NOW)..TO SUM IT UP, AFTER YOU FIXED THE MATH PART OF MY PROBLEM,IT STILL DID NOT WANT TO WORK..MY CALCULATOR CONFIRMS THE MATH IS PERFECT,MY MICRO CONTROLLER,NOT SO...SO AFTER LOOKING THROUGH MY CODE,I FOUND I WAS MULTIPLYING MY NUMBER BY 100 FIRST THEN TRYING TO DIVIDE... THAT GAVE STRANGE RESULTS,SO I USED A FLOATING POINT MATH ROUTINE,THE NUMBERS TO THE RIGHT OF THE DECIMAL POINT VERY IMPORTANT HERE.. WELL THAT WAS THREE HOURS OF INTENSIVE LEARNING...THANKS A MILLION FOR YOUR HELP,MUCH APPRECIATED...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor