PDA

View Full Version : how to calculate reverse value with scale



harryweb
- 10th December 2017, 22:22
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

Jerson
- 11th December 2017, 00:59
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

richard
- 11th December 2017, 01:10
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

harryweb
- 11th December 2017, 14:31
Ohhh yes yes ! I'm so tired... didn't saw as simple as it is !
Regards