socvur.blogg.se

Accelerometer adxl345 wire library code
Accelerometer adxl345 wire library code







accelerometer adxl345 wire library code accelerometer adxl345 wire library code

Set values for what is considered a TAP and what is a DOUBLE TAP (0-255)Īdxl.setTapThreshold(50) // 62.5 mg per incrementĪdxl.setTapDuration(15) // 625 μs per incrementĪdxl.setDoubleTapLatency(80) // 1.25 ms per incrementĪdxl.setDoubleTapWindow(200) // 1.25 ms per increment SPI pins on the ATMega328: 11, 12 and 13 as reference in SPI LibraryĪdxl.setActivityXYZ(1, 0, 0) // Set to activate movement detection in the axes "tActivityXYZ(X, Y, Z) " (1 = ON, 0 = OFF)Īdxl.setActivityThreshold(75) // 62.5mg per increment // Set activity // Inactivity thresholds (0-255)Īdxl.setInactivityXYZ(1, 0, 0) // Set to detect inactivity in all the axes "tInactivityXYZ(X, Y, Z) " (1 = ON, 0 = OFF)Īdxl.setInactivityThreshold(75) // 62.5mg per increment // Set inactivity // Inactivity thresholds (0-255)Īdxl.setTimeInactivity(10) // How many seconds of no activity is inactive?Īdxl.setTapDetectionOnXYZ(0, 0, 1) // Detect taps in the directions turned ON "tTapDetectionOnX(X, Y, Z) " (1 = ON, 0 = OFF) Higher Values = Wider Measurement RangeĪdxl.setSpiBit(0) // Configure the device to be in 4 wire SPI mode when set to '0' or 3 wire SPI mode when set to 1 Serial.println("SparkFun ADX元45 Accelerometer Hook Up Guide Example") Īdxl.setRangeSetting(8) // Give the range settings Serial.begin(9600) // Start the serial terminal int interruptPin = 2 // Setup pin 2 to be the interrupt pin (for most Arduino Boards) ADX元45 adxl = ADX元45() // USE FOR I2C COMMUNICATION * Comment Out The One You Are Not Using */ĪDX元45 adxl = ADX元45(10) // USE FOR SPI COMMUNICATION, ADX元45(CS_PIN) * Bildr ADX元45 source file modified to support

accelerometer adxl345 wire library code

* Triple Axis Accelerometer Breakout - ADX元45









Accelerometer adxl345 wire library code