LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

ADXL 345 Sparkfun-- I2c--LabVIEW--Arduino

Could you please attach your VI and post the link to the VI's or library that you are using for the MMA8452Q?

0 Kudos
Message 81 of 87
(1,487 Views)

Thanks Nathan for the reply

I have solved the problem.

0 Kudos
Message 82 of 87
(1,487 Views)

For this particular accelerometer, it will only send the number of bytes that it is initialized to send. You must read the datasheet and first initialize the accelerometers accuracy and data ranges (this will make more sense after you read it), specify baud rate and samples/sec, THEN you must convert the number from signed hex, but it doesn't use all 16 bits in X1,X0 (read in this order), depending on what accuracy/range you specify. I'm unsure as to the factory settings of this sensor, but if you re-initialize it before you start your data collection, you should see viable results.

Dan Haugen
Certified LabVIEW Developer
CLD Instructor
0 Kudos
Message 83 of 87
(1,487 Views)

Hello everyone, i am working with a sparkfun 9 dof stick and im reading the data with i2c.

My problem is that i dont know how to configure the components (for example i want to put 0x0A in 0x2D register that makes the acelerometer wake up) i can just read the data but i need to configure.

I am "translating" the arduino code to labview code, in arduino its easy :

wire.send(0x0A);

wire.send(0x2D);

But in labview when i want to acces into the gyroscope gt-3200 i underwrite the restricted areas and i take errors, so can u help me please?

how to write with i2c in a particular register without writing in the previous registers.

Thank you and a have a good day

0 Kudos
Message 84 of 87
(1,487 Views)

pablosjb,

I did a similar project, only SPI and in C language. The problem here is that you must send the message as one frame... There is a frame start sequence (series of bits), then your command (i.e., 'write to register') accompanied with a parameter (i.e. register address), then a close frame (series of bits). The problem you are having here is that instead of sending, in one frame, "write to 0x2D the value 0x0A", you are sending the requests "write to 0x2D","write to 0x0A". You will have to look up in the datasheet what instructions to send, where to put the address, and where to put the data you want in that address. For this, I had to manually construct my own SPI 'frame', since the C library I was using could not write enough information.

If you reference the communication frame infographic on the datasheet, it will explain this better.

Dan Haugen
Certified LabVIEW Developer
CLD Instructor
0 Kudos
Message 85 of 87
(1,487 Views)

thanks for the reply but the problem its not that.

I explain better the situation, i want to write in the registers 0x2D and 0x31, but in labview the frame of bytes, underwrite the 0x17 (i.e) where the data of axis (what i want to rate later) and it produces an error, do you understand me better? sorry for my english mate.

0 Kudos
Message 86 of 87
(1,487 Views)

Since LIFA (this forum) is old and unsupported, I'd recommend posting on the LINX forums (LINX is what replaces LIFA a couple years ago).  The ADXL345 is natively supported (I'm not sure how much of the extra functions are supported though).

What I'd recommend, use LINX then attempt to do what you are doing.  If you still can't get it working, post on the LINX forums a detailed description of what you are trying to do as well as attaching your LabVIEW VI where you tried to do your custom functionality.

LINX

MakerHub Forums (home of LINX).

0 Kudos
Message 87 of 87
(1,487 Views)