chinlin0924 / er9x

Automatically exported from code.google.com/p/er9x
0 stars 0 forks source link

FRSKY not reporting correct voltage #713

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. shows 1.64v when should be 4.2v
2.
3.

What is the expected output? What do you see instead?

in menu.cpp line 4941
lcd_outdezNAtt( x, y, (uint8_t)(FrskyVolts[k] * 2)
cast should not be (uint8_t) but (uint16_t)
0x834 = 4.2v Frame Protocol of FrSky Telemetry Hub System (V2.0)

in code FrskyVolts=0x834 /A= 0xD2 =210
then 210*2= 420=0x1a4 that is ok but we cast to 8 bits = 0xA4 =164

What version of the product are you using? On what operating system?

r776

Please provide any additional information below.

Original issue reported on code.google.com by pedro.j....@gmail.com on 30 Sep 2012 at 12:01

GoogleCodeExporter commented 8 years ago
FR_VOLTS not ok:

0x3A Voltage
(Ampere Sensor)
v U 0.5v / 0~48.0v Before “.”
0x3B After “.”
frsky.cpp line 173 : replaced by to have have 1 dec place truncated :
//FrskyHubData[FR_VOLTS] = (FrskyHubData[FR_V_AMP] * 10 + value) * 21 / 11 ;
            while( value / 10 >0){
            value=value / 10;
            }
            FrskyHubData[FR_VOLTS] = FrskyHubData[FR_V_AMP]*10 + value;

Original comment by pedro.j....@gmail.com on 2 Oct 2012 at 10:48