The SparkFun Triple Axis Accelerometer Breakout - ADXL362 is an ultra-low-power, 3-axis MEMS accelerometer that offers high resolution (12-bit) measurement at up to ±8g. Digital output data is formatted as 16-bit twos complement and is accessible through either a SPI (3- or 4-wire) or I2C digital interface.
Common Applications:
Pin Number | Name | Description |
---|---|---|
1 | GND | Ground connection |
2 | VCC | Power supply (1.6V to 3.5V) |
3 | SCL/CS | I2C clock/SPI chip select |
4 | SDA/SDI | I2C data/SPI data input |
5 | SDO | SPI data output |
6 | INT1 | Interrupt 1 output |
7 | INT2 | Interrupt 2 output |
8 | n/c | No connection |
#include <SPI.h>
#include <ADXL362.h>
ADXL362 xl;
void setup() {
Serial.begin(9600);
SPI.begin();
xl.begin(10); // SPI Chip Select Pin
xl.beginMeasure();
}
void loop() {
int x, y, z;
xl.readXYZTData(x, y, z, temperature); // Read acceleration data
Serial.print("X: "); Serial.print(x);
Serial.print(" Y: "); Serial.print(y);
Serial.print(" Z: "); Serial.println(z);
delay(100); // Adjust the delay as per the required output data rate
}
Note: Before using the code, ensure that the ADXL362 library is installed in your Arduino IDE.
xl.beginMeasure();
function to start measurement mode.Q: Can the ADXL362 operate at 5V? A: No, the ADXL362 is designed to operate between 1.6V and 3.5V.
Q: How can I change the measurement range? A: Use the library functions to set the measurement range to ±2g, ±4g, or ±8g as needed.
Q: What is the purpose of the INT1 and INT2 pins? A: These pins can be configured to output interrupt signals for events like activity, inactivity, or free-fall detection.
For further assistance, consult the ADXL362 datasheet and the SparkFun ADXL362 library documentation.