how to calculate reverse value with scale
Hi,
I cannot find how to convert my level value from receiver (from -130dBm to -30dBm) I do not use minus -> so 130 to 30
My display (nextion type) has a "vu meter" witch needs 0 to 100
When my receiver value is 130, I need to send 0 to LCD
When my receiver value is 30 then I need to send 100 to LCD
Regards
Re: how to calculate reverse value with scale
output = (reading+130)*10/16
should do it. Where I assume you are reading -130 to +30.
Thus, a reading of -130 will give output = 0
and a reading of +30 will give output = 100
Re: how to calculate reverse value with scale
or
output = 130-reading
should do it. Where I assume you are reading 130 to 30.
Thus, a reading of 130 will give output = 0
and a reading of 30 will give output = 100
Re: how to calculate reverse value with scale
Ohhh yes yes ! I'm so tired... didn't saw as simple as it is !
Regards