Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. 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 static GetInstance method of the sensor that interests you (in the sample, there is only the MS5637 altimeter bmx160 imu available, but there may be more) and assign that result to a pointer of the base class type (in this case Altimeter IMU).

  2. (Only if the sensor has a Begin_Measuring method). In the second thread mentioned in (1), call the Begin_Measuring method at a regular interval.

  3. 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 time GetResult was called.

...