Dear friend,
I need to communicate with adxl345 accelerometer using LPC1768's 4 wire spi interface. does anybody have a library for this purpose? (I need to enable activity and inactivity interrupts)
If not has anyone ever worked with this module? How am I supposed to write a value to a special register of the module?
yours sincerely
I worked with that device with i2c interface. You need to select register you wish to read/write and send parameter that is expected.
e.g.
#define ADXL345_ADDR 0x1D #define DEVICE_ID 0x00 uint8_t deviceId = i2c_read(ADXL345_ADDR, DEVICE_ID);
Command like device id, just need to read 1 byte from register with address 0x00.
To read X value from sensor, you need to read two registers.
#define OUT_X_L 0x32 #define OUT_X_H 0x33 uint16_t xVal = i2c_read(ADXL345_ADDR, OUT_X_L) | (i2c_read(ADXL345_ADDR, OUT_X_H)<<8))
Dear Sven S,
I am doing similar project interfacing I2C with ADXL345 + LPC1768 I am struct up. can you please share the keil code to my mail id sudhakar.mareddy@gmail.com thanks in Advance
Regards, SudhakarM
Hello,
if you donr mind can you send me the keil code for this project my email I.D is sanjeev.suresh@ktu,edu
thank you