TOP Contributors

  1. MIKROE (2642 codes)
  2. Alcides Ramos (347 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136222 times)
  2. FAT32 Library (69487 times)
  3. Network Ethernet Library (55706 times)
  4. USB Device Library (45992 times)
  5. Network WiFi Library (41639 times)
  6. FT800 Library (40782 times)
  7. GSM click (28788 times)
  8. PID Library (26332 times)
  9. mikroSDK (26054 times)
  10. microSD click (25140 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

Accel 6 click

Rating:

5

Author: MIKROE

Last Updated: 2018-06-29

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Motion

Downloaded: 4113 times

Not followed.

License: MIT license  

Accel 6 click is a three-axis acceleration sensor with many features. It uses the BMA280, a 14bit triaxial acceleration sensor with intelligent on-chip motion triggered interrupt controller, from Bosch Sensortec.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Accel 6 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Accel 6 click" changes.

Do you want to report abuse regarding "Accel 6 click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Accel 6 click

Accel 6 click

Native view of the Accel 6 click board.

View full image
Accel 6 click

Accel 6 click

Front and back view of the Accel 6 click board.

View full image

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 );
}


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 USB UART clickUSB 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.

ALSO FROM THIS AUTHOR

2x30W Amp click

5

2x30W Amp click is a class-D audio amplifier with a tremendous output power, considering its size and lack of huge heatsinks, usually associated with the audio amplifiers.

[Learn More]

BT Audio 2 click

0

BT Audio 2 Click is Bluetooth audio stream add on board based on BM62 module from Microchip. It's a Stereo Audio module which is fully qualified Bluetooth v5.0 dual-mode (BDR/EDR/BLE) to be added in any wireless audio and voice application. With features like high resolution up to 24-bit, 96 kHz audio data format, Bluetooth Low Energy data rate up to 1Mbits/s, connection of two hosts with HFP/A2DP profiles simultaneously, seamless serial data over UART interface and many more it's perfect solution for applications like portable speakers and headsets.

[Learn More]

Tamper click

5

Tamper click is equipped with SDS001, a low profile side-actuated detect switch, made by C&K company. The click is additionally equipped with the RC filter that minimizes the bouncing effect, making this click a reliable solution for any contact detection application.

[Learn More]