EasyManua.ls Logo

Mcube MC3635 - Library Reference; Create MCUBE_MC36 XX Object; Initialize and Configure Sensor; Set Range

Mcube MC3635
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...
MC3635 3-Axis Accelerometer EV3635B Quick Start Guide and Demo
mCube Proprietary. APS-045-0018v1.2 12 / 20
© 2020 mCube Inc. All rights reserved.
4 LIBRARY REFERENCE
4.1 CREATE MCUBE_MC36XX OBJECT
You can create the MCUBE_MC36XX object with:
MC36XX MC36XX_acc = MC36XX();
4.2 INITIALIZE AND CONFIGURE SENSOR
Initialize and configure the sensor with:
MC36XX_acc.start();
Wake up sensor with your own configuration, it will follow the factory default setting:
MC36XX_acc.wake();
Stop sensor to change setting:
MC36XX_acc.stop();
Set sensor as sniff mode:
MC36XX_acc.sniff ();
4.3 SET RANGE
Set the accelerometer max range to ±2g, ±4g, ±8g or ±16g with:
MC36XX_acc.SetRangeCtrl(MC36XX_RANGE_8G);
4.4 READ RANGE
Read the current range with:
MC36XX_acc.GetRangeCtrl();
It returns: 0 for ±2g, | 1 for ±4g, | 2 for ±8g | 3 for ±16g.
4.5 SET RESOLUTION
Set the accelerometer resolution to 6, 7, 8, 10, 12 or 14 bit.
MC36XX_acc.SetResolutionCtrl(MC36XX_RESOLUTION_14BIT);
When the FIFO is enabled, the output of the FIFO is mapped to registers 0x02 to 0x07,
and the data has a maximum resolution of 12-bits.