EasyManua.ls Logo

Mcube MC3419 - Library Reference; Initialize and Configure Sensor

Mcube MC3419
20 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
MC3419 3-Axis Accelerometer EV3419A Quick Start Guide and Demo
mCube Proprietary. APS-045-0033v1.0 12 / 20
© 2020 mCube Inc. All rights reserved.
4 LIBRARY REFERENCE
4.1 CREATE MCUBE_MC34X9 OBJECT
You can create the MCUBE_MC34X9 object with:
MC34X9 MC34X9_acc = MC34X9();
4.2 INITIALIZE AND CONFIGURE SENSOR
Initialize and configure the sensor with:
MC34X9_acc.start(bSpi, chipSelect);
Wake up sensor with your own configuration, it will follow the factory default setting:
MC34X9_acc.wake();
Stop sensor to change setting:
MC34X9_acc.stop();
4.3 SET RANGE
Set the accelerometer max range to ±2g, ±4g, ±8g, ±16g or ±12g with:
MC34X9_acc.SetRangeCtrl(MC34X9_RANGE_8G);
4.4 READ RANGE
Read the current range with:
MC34X9_acc.GetRangeCtrl();
It returns: 0 for ±2g, | 1 for ±4g, | 2 for ±8g | 3 for ±16g | 4 for ±12g.
4.5 SET SAMPLING RATE
Set the accelerometer sampling rate with:
MC34X9_acc.SetSampleRate(MC34X9_ SR_DEFAULT_1000Hz);