LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Hello Gert-Jan,

Can you send the working VI please? I tried it accordig to your block diagram but I couldn't get it worked? If possible, I will appreciate it.

0 Kudos
Message 31 of 87
(2,723 Views)

https://decibel.ni.com/content/docs/DOC-26332 

Keep an eye on the wiring as drawn in my previous post!

Message 32 of 87
(2,723 Views)

Hello again,

I got it after I asked for the VI thank you very much, I made a mistake with the connection.

Could you possibly know how to connect multiple adxl345 or is it possible with Arduino? I need two of them at least. And is there a way in labview to visualize orientation?

0 Kudos
Message 33 of 87
(2,723 Views)

Hi,

2 accelerometers is possbile! you just have to choose another device address for the second accelerometer (you can choose between 0x1D and 0x53).

In the datascheet (see link), on page 10 there is a descripion how the set the addres (set some pins to high or low). After setting the address you have to change the vi and set up the second device with his address.

Greets, Gert-Jan

0 Kudos
Message 34 of 87
(2,723 Views)

Hello again,

I haven't tried 2 accelerometers yet. But I am sending the VI I was working on. I hope with some help we can make it better. I was trying the visiluaze it in 3D. I got it working but the problem is I couldn't get Z axis  working properly. It may be my sensor but probably it is the VI.  Also I couldn't make the movement continuous after 360degree it turns to all the way to zero and does not seem all right.

I eventually want to use data for PID control of a couple dc motors with visual. Any help will be appreciated.

0 Kudos
Message 35 of 87
(2,723 Views)

Hey

thanks a lot for this VI.

I have connected the pins as you have shown in your picture but it's not working. There is no error shown.

What sketch do i have to use for the arduino?

Greets, gs

EDIT: Everything is working fine thanks a lot

But I still have a problem with my laptop port. Everytime I stop the VI i can't start it again because of connection issues to Arduino.

I'm using Win7.

If someone has an idea it would be nice if he could tell me.

greets

0 Kudos
Message 36 of 87
(2,723 Views)

gs_uno wrote:

But I still have a problem with my laptop port. Everytime I stop the VI i can't start it again because of connection issues to Arduino.

I'm using Win7.

If someone has an idea it would be nice if he could tell me.

greets

Generally, this happens when you stop the VI with the "abort execution" button (the stop sign).  Never use the abort execution button when working with Arduino, you must always let the Close.vi run to successfully clear the VISA resource.

0 Kudos
Message 37 of 87
(2,723 Views)

Hi,

Here is an improved version that incorporates all 10 bits (or max 13 bits in full resolution):

Test ADXLl345.jpg

The credit of the above fix goes to Nathan_B., who has provided us w/ a neat library.

BTW, I fixed a couple of minor bugs in Nathan's LIFA ADXL345 library. Please refer to: https://decibel.ni.com/content/docs/DOC-28504

Thanks to Gert-Jan_A and Nathan_B. for their generosity.

Cheers

Updated test adx345 2010: removed a TypeDef dependency that wasn't included here as a separate .ctl

Download All
Message 38 of 87
(2,723 Views)

Hi,

     I am trying to connect multiple ADXL345 to ARDUINO board (Via I2C), Do you have a source code for that. I have tried SPI with ADXL345 and have a VI for that but do you have a vi for SPI (For multiple accelerometers). What is the maximum number of ADXL345 I can connect to ARDUINO ? Any help is appreciated.

Thank you!

0 Kudos
Message 39 of 87
(2,723 Views)

If using I2C you are only able to use two ADXL345s.  You will need to make sure the second one has the alternate device address.  If using SPI, I believe simply requires just another chip select pin.

0 Kudos
Message 40 of 87
(2,723 Views)