Adafruit ADXL343 Library
Classes | Macros | Enumerations
Adafruit_ADXL343.h File Reference
#include "WProgram.h"
#include <Adafruit_BusIO_Register.h>
#include <Adafruit_I2CDevice.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>

Go to the source code of this file.

Classes

union  int_config
 
class  Adafruit_ADXL343
 

Macros

#define ADXL343_ADDRESS   (0x53)
 
#define ADXL343_REG_DEVID   (0x00)
 
#define ADXL343_REG_THRESH_TAP   (0x1D)
 
#define ADXL343_REG_OFSX   (0x1E)
 
#define ADXL343_REG_OFSY   (0x1F)
 
#define ADXL343_REG_OFSZ   (0x20)
 
#define ADXL343_REG_DUR   (0x21)
 
#define ADXL343_REG_LATENT   (0x22)
 
#define ADXL343_REG_WINDOW   (0x23)
 
#define ADXL343_REG_THRESH_ACT   (0x24)
 
#define ADXL343_REG_THRESH_INACT   (0x25)
 
#define ADXL343_REG_TIME_INACT   (0x26)
 
#define ADXL343_REG_ACT_INACT_CTL   (0x27)
 
#define ADXL343_REG_THRESH_FF   (0x28)
 
#define ADXL343_REG_TIME_FF   (0x29)
 
#define ADXL343_REG_TAP_AXES   (0x2A)
 
#define ADXL343_REG_ACT_TAP_STATUS   (0x2B)
 
#define ADXL343_REG_BW_RATE   (0x2C)
 
#define ADXL343_REG_POWER_CTL   (0x2D)
 
#define ADXL343_REG_INT_ENABLE   (0x2E)
 
#define ADXL343_REG_INT_MAP   (0x2F)
 
#define ADXL343_REG_INT_SOURCE   (0x30)
 
#define ADXL343_REG_DATA_FORMAT   (0x31)
 
#define ADXL343_REG_DATAX0   (0x32)
 
#define ADXL343_REG_DATAX1   (0x33)
 
#define ADXL343_REG_DATAY0   (0x34)
 
#define ADXL343_REG_DATAY1   (0x35)
 
#define ADXL343_REG_DATAZ0   (0x36)
 
#define ADXL343_REG_DATAZ1   (0x37)
 
#define ADXL343_REG_FIFO_CTL   (0x38)
 
#define ADXL343_REG_FIFO_STATUS   (0x39)
 
#define ADXL343_MG2G_MULTIPLIER   (0.004)
 

Enumerations

enum  dataRate_t {
  ADXL343_DATARATE_3200_HZ = 0b1111, ADXL343_DATARATE_1600_HZ = 0b1110, ADXL343_DATARATE_800_HZ = 0b1101, ADXL343_DATARATE_400_HZ = 0b1100,
  ADXL343_DATARATE_200_HZ = 0b1011, ADXL343_DATARATE_100_HZ = 0b1010, ADXL343_DATARATE_50_HZ = 0b1001, ADXL343_DATARATE_25_HZ = 0b1000,
  ADXL343_DATARATE_12_5_HZ = 0b0111, ADXL343_DATARATE_6_25HZ = 0b0110, ADXL343_DATARATE_3_13_HZ = 0b0101, ADXL343_DATARATE_1_56_HZ = 0b0100,
  ADXL343_DATARATE_0_78_HZ = 0b0011, ADXL343_DATARATE_0_39_HZ = 0b0010, ADXL343_DATARATE_0_20_HZ = 0b0001, ADXL343_DATARATE_0_10_HZ = 0b0000
}
 
enum  range_t { ADXL343_RANGE_16_G = 0b11, ADXL343_RANGE_8_G = 0b10, ADXL343_RANGE_4_G = 0b01, ADXL343_RANGE_2_G = 0b00 }
 
enum  int_pin { ADXL343_INT1 = 0, ADXL343_INT2 = 1 }
 

Detailed Description

Author
Bryan Siepert and K. Townsend (Adafruit Industries)

BSD license (see license.txt)

This is a library for the Adafruit ADS1015 breakout board -—> https://www.adafruit.com/products/???

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

v1.0 - First release

Macro Definition Documentation

◆ ADXL343_ADDRESS

#define ADXL343_ADDRESS   (0x53)

Assumes ALT address pin low

◆ ADXL343_REG_DEVID

#define ADXL343_REG_DEVID   (0x00)

Device ID

◆ ADXL343_REG_THRESH_TAP

#define ADXL343_REG_THRESH_TAP   (0x1D)

Tap threshold

◆ ADXL343_REG_OFSX

#define ADXL343_REG_OFSX   (0x1E)

X-axis offset

◆ ADXL343_REG_OFSY

#define ADXL343_REG_OFSY   (0x1F)

Y-axis offset

◆ ADXL343_REG_OFSZ

#define ADXL343_REG_OFSZ   (0x20)

Z-axis offset

◆ ADXL343_REG_DUR

#define ADXL343_REG_DUR   (0x21)

Tap duration

◆ ADXL343_REG_LATENT

#define ADXL343_REG_LATENT   (0x22)

Tap latency

◆ ADXL343_REG_WINDOW

#define ADXL343_REG_WINDOW   (0x23)

Tap window

◆ ADXL343_REG_THRESH_ACT

#define ADXL343_REG_THRESH_ACT   (0x24)

Activity threshold

◆ ADXL343_REG_THRESH_INACT

#define ADXL343_REG_THRESH_INACT   (0x25)

Inactivity threshold

◆ ADXL343_REG_TIME_INACT

#define ADXL343_REG_TIME_INACT   (0x26)

Inactivity time

◆ ADXL343_REG_ACT_INACT_CTL

#define ADXL343_REG_ACT_INACT_CTL   (0x27)

Axis enable control for activity and inactivity detection

◆ ADXL343_REG_THRESH_FF

#define ADXL343_REG_THRESH_FF   (0x28)

Free-fall threshold

◆ ADXL343_REG_TIME_FF

#define ADXL343_REG_TIME_FF   (0x29)

Free-fall time

◆ ADXL343_REG_TAP_AXES

#define ADXL343_REG_TAP_AXES   (0x2A)

Axis control for single/double tap

◆ ADXL343_REG_ACT_TAP_STATUS

#define ADXL343_REG_ACT_TAP_STATUS   (0x2B)

Source for single/double tap

◆ ADXL343_REG_BW_RATE

#define ADXL343_REG_BW_RATE   (0x2C)

Data rate and power mode control

◆ ADXL343_REG_POWER_CTL

#define ADXL343_REG_POWER_CTL   (0x2D)

Power-saving features control

◆ ADXL343_REG_INT_ENABLE

#define ADXL343_REG_INT_ENABLE   (0x2E)

Interrupt enable control

◆ ADXL343_REG_INT_MAP

#define ADXL343_REG_INT_MAP   (0x2F)

Interrupt mapping control

◆ ADXL343_REG_INT_SOURCE

#define ADXL343_REG_INT_SOURCE   (0x30)

Source of interrupts

◆ ADXL343_REG_DATA_FORMAT

#define ADXL343_REG_DATA_FORMAT   (0x31)

Data format control

◆ ADXL343_REG_DATAX0

#define ADXL343_REG_DATAX0   (0x32)

X-axis data 0

◆ ADXL343_REG_DATAX1

#define ADXL343_REG_DATAX1   (0x33)

X-axis data 1

◆ ADXL343_REG_DATAY0

#define ADXL343_REG_DATAY0   (0x34)

Y-axis data 0

◆ ADXL343_REG_DATAY1

#define ADXL343_REG_DATAY1   (0x35)

Y-axis data 1

◆ ADXL343_REG_DATAZ0

#define ADXL343_REG_DATAZ0   (0x36)

Z-axis data 0

◆ ADXL343_REG_DATAZ1

#define ADXL343_REG_DATAZ1   (0x37)

Z-axis data 1

◆ ADXL343_REG_FIFO_CTL

#define ADXL343_REG_FIFO_CTL   (0x38)

FIFO control

◆ ADXL343_REG_FIFO_STATUS

#define ADXL343_REG_FIFO_STATUS   (0x39)

FIFO status

◆ ADXL343_MG2G_MULTIPLIER

#define ADXL343_MG2G_MULTIPLIER   (0.004)

4mg per lsb

Enumeration Type Documentation

◆ dataRate_t

enum dataRate_t

Used with register 0x2C (ADXL343_REG_BW_RATE) to set bandwidth

Enumerator
ADXL343_DATARATE_3200_HZ 

3200Hz Bandwidth

ADXL343_DATARATE_1600_HZ 

1600Hz Bandwidth

ADXL343_DATARATE_800_HZ 

800Hz Bandwidth

ADXL343_DATARATE_400_HZ 

400Hz Bandwidth

ADXL343_DATARATE_200_HZ 

200Hz Bandwidth

ADXL343_DATARATE_100_HZ 

100Hz Bandwidth

ADXL343_DATARATE_50_HZ 

50Hz Bandwidth

ADXL343_DATARATE_25_HZ 

25Hz Bandwidth

ADXL343_DATARATE_12_5_HZ 

12.5Hz Bandwidth

ADXL343_DATARATE_6_25HZ 

6.25Hz Bandwidth

ADXL343_DATARATE_3_13_HZ 

3.13Hz Bandwidth

ADXL343_DATARATE_1_56_HZ 

1.56Hz Bandwidth

ADXL343_DATARATE_0_78_HZ 

0.78Hz Bandwidth

ADXL343_DATARATE_0_39_HZ 

0.39Hz Bandwidth

ADXL343_DATARATE_0_20_HZ 

0.20Hz Bandwidth

ADXL343_DATARATE_0_10_HZ 

0.10Hz Bandwidth (default value)

◆ range_t

enum range_t

Used with register 0x31 (ADXL343_REG_DATA_FORMAT) to set g range

Enumerator
ADXL343_RANGE_16_G 

+/- 16g

ADXL343_RANGE_8_G 

+/- 8g

ADXL343_RANGE_4_G 

+/- 4g

ADXL343_RANGE_2_G 

+/- 2g (default value)

◆ int_pin

enum int_pin

Possible interrupt pin outputs on the ADXL343.