02-19-2012 11:32 AM
Hi,
Im working with arduino uno and ADXL345 accelerometer from sparkfun. i can write and read the 3 axis between arduino and adxl345. Now im trying to use labview to read the data. Below is the configuration i have done in vi.
83 (0x53) is the device address of adxl345, 0x32 is the register address for first axis acceleration provided in the datasheet (http://www.sparkfun.com/products/9836). and (http://www.sparkfun.com/datasheets/Sensors/Accelerometer/ADXL345.pdf).
im going to read 6 byte from address 0x32 and end with 0x37. However, the vi cannot read the data. i am wondering what is the problem. Im using the latest version for LabVIEW interface for Arduino (2. 1.1.69) and the latest version of Arduino release 1.0.
what should i do? Is there any particular code in Arduino that i missed? Really need help.
Thank You.
02-25-2012 10:14 PM
I don't have one of these yet but I've been working with similar digital sensors and it looks correct to me. Are you sure the 32 is in Hex?
04-15-2012 01:58 AM
So, since the last time that I posted I've worked with another accelerometer that sends the data exactly the same way. You have to combine the LSB and MSB from each axis to get usable numbers. Here is how it's done:
04-23-2012 03:53 PM
Nathan, do you happen to have the rest of this or sample code to read from the ADXL345? I'm looking to do some reading and would like to see some ways to get started. Thanks.
04-23-2012 05:51 PM
I don't have a ADXL345 so my code will not be exactly the same. If multiple-byte reads are on by default then you should be able to just use the code in the first post and then interpret the data array that you get from the I2C read with the code I posted above. Make sure that the 32 is hex.
05-08-2012 05:54 AM
Can somebody post the .vi archive?
05-08-2012 11:11 AM
To what are you refering?
07-17-2012 12:54 AM
Has anyone got a sample vi for adxl345 and i2c finally? I am trying but i 've reached dead end.
07-17-2012 07:22 PM
I could try to write some functions for this sometime if the OP hasn't figured it out and posts for you.
07-18-2012 10:53 PM
Here ya go. I found out the major reason why the OP's code didn't work. Let me know if something doesn't work as expected.
Remember to initiate and close I2C communications correctly when using these VIs.
EDIT: Updated my library below.