Accelerometer help needed for A-Level project!

Storey

New member

lbenson

Senior Member
What's your wiring diagram and what code have you been trying with?

And welcome to the forum.
 

depeet

New Member
I've read the datasheet and created a excel-sheet. Just insert 1 or 0 for bits D7 to D0 and the column VALUE presents the needed value to write to appropiate register.
The datasheet (page 13) mentions that it is recommended to configure the device in standby mode and then set bit D3 of register 0x2D to enable the measure mode.
The data can be read from registerpair 0x32, 0x33 for the X-axis, registerpair 0x34, 0x35 for Y-axis and registerpair 0x36, 0x37 for Z-axis
Apparently the address of the device could be 0x3A or 0xA6 depending if pin 12 if the IC is connected to ground.
Don't forget to place pullup resistor (10kOhms) on the lines SCL and SDA.
 

Attachments

lbenson

Senior Member
I don't really have a wiring diagram and I've just been trying to readadc + debug on the pins.
I thought the device linked was an I2C device, and so has no pins on which you can use READADC. Unless I'm mistaken, we'd need to see the code with which you communicate with the module using the I2C commands.
 

hippy

Technical Support
Staff member
I don't really have a wiring diagram and I've just been trying to readadc + debug on the pins.
That could be the problem; the ADXL345 is not a device which has analogue outputs but requires using an I2C interface to use it.
 

Buzby

Senior Member
Here is a simple program for reading the ADXL345. ( Ignore the preview heading below, the original thread was talking about a different chip. )

You may need to try 0x3A or 0xA6 in the setup. When it works you will get the chipID value back, decimal 229.

Once you get this you know the comms is working OK, then the fun starts !.

 
Top