Prop Shield Altimeter

Status
Not open for further replies.

Citabria

Active member
I see a function in the NXPMotionSense library to read altitude from the pressure sensor, but it's private:
Code:
private:
	void update();
	bool FXOS8700_begin();
	bool FXAS21002_begin();
	bool MPL3115_begin();
	bool FXOS8700_read(int16_t *data);
	bool FXAS21002_read(int16_t *data);
	bool MPL3115_read(int32_t *altitude, int16_t *temperature);
...

So, how can I read the altitude in my sketch?
 
I found two workarounds. First, just
Code:
#define private public
which is naughty.

Second, make local copies of the functions
Code:
bool MPL3115_read(int32_t *altitude, int16_t *temperature)
static bool read_regs(uint8_t i2c, uint8_t addr, uint8_t *data, uint8_t num)
static bool read_regs(uint8_t i2c, uint8_t *data, uint8_t num)
which is a last resort.

Paul, may I ask you to make it public?
 
Status
Not open for further replies.
Back
Top