Hello All,
I have a bit of a scaling problem. I am sure it's not that hard. I searched the forums last night for "scaling" and read about 15 pages of search results until midnight last night and toyed around with it a bit more today, but no luck. Possibly some of the math guru's can help.
This is the scaling for a 10K ohm potentiometer in my 28X2 chip project when the potentiomerter is fully CCW and CW. This scales a number from 6 to 85.
"1st scaled number"
ReadADC A.3, b0
w0 = b0 * 79 / 255 + 6
My problem is, I would like to scale the same potentiometer, but in the opposite direction from 42 to 4. (what do you call this... reverse scaling???)
"2nd scaled number"
ReadADC A.3, b2
w1 = b2 ??????
So.... when the 1st scaled number = 6, I'd like the second scaled number to be 42. And when the first scaled number = 85, I'd like the second scaled number to be 4.
Thanks in advance.
"The Addict"
I have a bit of a scaling problem. I am sure it's not that hard. I searched the forums last night for "scaling" and read about 15 pages of search results until midnight last night and toyed around with it a bit more today, but no luck. Possibly some of the math guru's can help.
This is the scaling for a 10K ohm potentiometer in my 28X2 chip project when the potentiomerter is fully CCW and CW. This scales a number from 6 to 85.
"1st scaled number"
ReadADC A.3, b0
w0 = b0 * 79 / 255 + 6
My problem is, I would like to scale the same potentiometer, but in the opposite direction from 42 to 4. (what do you call this... reverse scaling???)
"2nd scaled number"
ReadADC A.3, b2
w1 = b2 ??????
So.... when the 1st scaled number = 6, I'd like the second scaled number to be 42. And when the first scaled number = 85, I'd like the second scaled number to be 4.
Thanks in advance.
"The Addict"
Last edited: