Accel 6 Click Board
Accel 6 Click Board
The Accel 6 Click Board™ is a three-axis acceleration sensor with many features. It uses the BMA280, a 14-bit triaxial acceleration sensor with an intelligent on-chip motion-triggered interrupt controller, from Bosch Sensortec. This sensor has an advanced set of features, that allows easy acceleration measurement in three perpendicular axes for up to ±16g, with selectable max range steps for increased accuracy.
Using a low-pass filter allows filtering of the abrupt changes in acceleration readings. FIFO buffer ensures reliable and fast data delivery. Intelligent interrupt engine allows detection of motion, inactivity, shock vibration, new data arrival, and more.
Software Support
We provide a demo application for the Accel 6 Click Board™ on our Libstock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library initializes and defines the I2C bus driver and drivers that offer a choice for writing data in the register. The library includes the function for reading the X/Y/Z axis data, orient chip, detect tap and slope on the chip and function for reading the temperature data. The user also has the function for initializes chip, set offset and software reset.
Key Functions
float accel6_getAxis(uint8_t axis)
- Functions for reading the axis data.void accel6_getOrient(uint8_t *z_orient, uint8_t *xy_orient)
- Functions for reading the orient.uint8_t accel6_getTapStatus()
- Functions for detect tap on the x/y/z axis.
Example Description
The application is composed of three sections:
- System Initialization - Initializes I2C module.
- Application Initialization - Initializes Driver init and settings accelerometer data range, bandwidth, mode and sleep timer which are necessary for the Init chip.
- Application Task - (code snippet) - Reads the Accel X / Y / Z axis data in mg,
Temperature data in C, detects the orientation of the X, Y, and Z axis
and checking on which axis the tap is detected.
All data logs on USB UART for every 500 ms.
void applicationTask() { mikrobus_logWrite(" X axis : ", _LOG_TEXT); fAxis = accel6_getAxis(_ACCEL6_AXIS_X); FloatToStr(fAxis, demoText); mikrobus_logWrite(demoText, _LOG_TEXT); mikrobus_logWrite(" mg ", _LOG_LINE); mikrobus_logWrite(" Y axis : ", _LOG_TEXT); fAxis = accel6_getAxis(_ACCEL6_AXIS_Y); FloatToStr(fAxis, demoText); mikrobus_logWrite(demoText, _LOG_TEXT); mikrobus_logWrite(" mg ", _LOG_LINE); mikrobus_logWrite(" Z axis : ", _LOG_TEXT); fAxis = accel6_getAxis(_ACCEL6_AXIS_Y); FloatToStr(fAxis, demoText); mikrobus_logWrite(demoText, _LOG_TEXT); mikrobus_logWrite(" mg ", _LOG_LINE); mikrobus_logWrite(" Temperature : ", _LOG_TEXT); Temp = accel6_getTemperature(); FloatToStr(Temp, demoText); mikrobus_logWrite(demoText, _LOG_TEXT); mikrobus_logWrite(" C ", _LOG_LINE); accel6_getOrient(&z_orient[0], &xy_orient[0]); switch(z_orient[0]) { case 1: { mikrobus_logWrite(" Z orient : UPWARD looking ", _LOG_LINE); break; } case 2: { mikrobus_logWrite(" Z orient : DOWNWARD looking ", _LOG_LINE); break; } default: { break; } } switch(xy_orient[0]) { case 1: { mikrobus_logWrite(" XY orient : UPSIDE DOWN ", _LOG_LINE); break; } case 2: { mikrobus_logWrite(" XY orient : LANDSCAPE LEFT ", _LOG_LINE); break; } case 3: { mikrobus_logWrite(" XY orient : LANDSCAPE RIGHT ", _LOG_LINE); break; } case 4: { mikrobus_logWrite(" XY orient : UPRIGHT ", _LOG_LINE); break; } default: { break; } } tap_detect = accel6_getTapStatus(); switch( tap_detect ) { case 1: { mikrobus_logWrite(" Tap status : X negative ", _LOG_LINE); break; } case 2: { mikrobus_logWrite(" Tap status : Y negative ", _LOG_LINE); break; } case 3: { mikrobus_logWrite(" Tap status : Z negative ", _LOG_LINE); break; } case 4: { mikrobus_logWrite(" Tap status : X positive ", _LOG_LINE); break; } case 5: { mikrobus_logWrite(" Tap status : Y positive ", _LOG_LINE); break; } case 6: { mikrobus_logWrite(" Tap status : Z positive ", _LOG_LINE); break; } default: { break; } } mikrobus_logWrite(" ", _LOG_LINE); Delay_ms( 500 ); }
The full application code, and ready to use projects can be found on our Libstock page.
Other MikroElektronika libraries used in the example:
- I2C
- UART
- Conversions
Additional Notes and Information
Depending on the development board you are using, you may need a USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
MIKROSDK
The Accel 6 Click Board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant click board demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
Accel 6 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.