...
Instantiate the sensor object in the thread you wish to have the data in. If the particular sensor has a
Begin_Measuring
method, you’ll need to instantiate a second object in the same way in the second thread. Do this by calling the staticGetInstance
method of the sensor that interests you (in the sample, there is only theMS5637
altimeterbmx160
imu available, but there may be more) and assign that result to a pointer of the base class type (in this caseAltimeter
IMU
).(Only if the sensor has a
Begin_Measuring
method). In the second thread mentioned in (1), call theBegin_Measuring
method at a regular interval.In the data thread, you are free to call
GetResult
as frequently as you want (it’s non blocking). The contents of the returned struct will not only include the latest available data but will also include an indication of whether the data has been refreshed since last timeGetResult
was called.
...