How To use TestValue ?

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
Fabe
Posts: 17
Joined: Tue Jan 12, 2016 6:23 pm
Country: France

How To use TestValue ?

Post by Fabe »

Hi all,

I made my first OpenXsensor Alti/vario, and it's working great with X9E and X8R !

Now, I would like to send MS5611 internal temperature to T1 OXS field.

I check configuration file, and I read there's some TEST var, but I don't know How To write the code, and where (maybe oXs_ms5611.h file....).

There's two variables for TEST1 field :

- test1Value > insert MS5211 temperature
- test1ValueAvailable = true in order to activate this field

Regards,

Fabien

mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: How To use TestValue ?

Post by mstrens »

The principe is normally to add some code in the .ino file.
Search at a function readSensors().
At the end of this function, you could add 2 lines
test1Value = oXs_MS5611.varioData.temperature ;
test1ValueAvailable = true ;

Then add TEST1 to your config.h file in order to send this data (e.g. as T1 or T2)

Still, I did not put this option in the normal code because the temperature is not really accurate. It is the internal temperature of the MS5611.
As the MS5611 is read at high frequency, his temperature is about 3-5 degrees above the temperature of air around it.

If you really want to get the real temperature, it is better to use a temperature sensor that return a voltage depending on the temperature. You can then configure oXs in order to measure this voltage and convert it into a temperature (using the multiplier/divider/offset when you transmit the data).

If you need more help, let me know
Fabe
Posts: 17
Joined: Tue Jan 12, 2016 6:23 pm
Country: France

Re: How To use TestValue ?

Post by Fabe »

Thanks a lot !

As you write, I find the readSensors() function :D
With v5.0, there's already somthing similar, but with test3Value :

Code: Select all

#ifdef VARIO
  oXs_MS5611.readSensor(); // Read pressure & temperature on MS5611, calculate Altitude and vertical speed
  if ( oXs_MS5611.varioData.absoluteAltAvailable == true and oXs_MS5611.varioData.rawPressure > 100000.0f ) actualPressure = oXs_MS5611.varioData.rawPressure / 10000.0 ; // this value can be used when calculating the Airspeed
  test3Value = oXs_MS5611.varioData.temperature; 
  test3ValueAvailable = true ; 
#endif
So, I will add test1Value, and let you know ;)

I know this temperature will not be the real temperature inside the model, but it could be a good value in order to make an alarm if temperature is too hot inside (electrical glider with a black carbon canopy during summer....)

Regards,

Fabien
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: How To use TestValue ?

Post by mstrens »

you can use test3Value too.
It does not matter if the temperature is filled in test1 or test3 as long as config.h is adapted accordingly.
Fabe
Posts: 17
Joined: Tue Jan 12, 2016 6:23 pm
Country: France

Re: How To use TestValue ?

Post by Fabe »

Hi mstrens,

It works ! I can read MS5611 temperature ;)

Thanks a lot !

Post Reply

Return to “OpenXVario - an open source vario supported by the open source firmwares!!”