05-29-2015 07:51 PM
So I've found that LabVIEW is reading my data from the Arduino, but I'm not sure what's going wrong after that. Here's an image of my VI.
Now, when I open up the "Arduino Init" block (seen on the left in the above picture) I get the following:
Note that this is only the right side of "Arduino Init". When I open the Arduino send/receive I get this:
Notice how in the "Read Buffer" you can see "x: 320". This x value is the same as the acceleration given out by the Arduino. Now when I click the run button, it reads the acceleration value, displays it in "Read Buffer" and then the program stops, when I click run again it provides the y acceleration value, and when I click run again it provides the z acceleration, and this keeps repeating.
But I can't seem to graph what's coming out of send/receive. The graphs keep showing 0's or sometimes the graph time axis doesn't even begin to move. Could this possibly be because its reading "x:320"? Do I need to change it to just read the number, in this case "320"?
05-29-2015 08:28 PM
05-29-2015 08:37 PM
"Since you are sending a termination charcter, the configure serial port should have this enabled."
Could you eleborate on this? I have no idea how to enable this on the configure serial port.
I understand what you are saying about the bytes though, it makes much more sense now.
05-29-2015 09:15 PM
05-29-2015 09:32 PM
So I was looking at all the components on my block diagram with "Context Help" on and I found that the Context Help for the "I2C init" block says "Arduino Uno Analog Pin 4 - SDA (data line)" and "Arduino Uno Analog Pin 5 -SCL (clock line)". I'm using the SDA and SCL pins, but I'm using the digital ones. I included a picture of the Arduino Uno below, I'm using "(I2C) SCL" and "(I2C) SDA" (top left of the board) NOT the analog "(I2C) SCL" -- (A5) and "(I2C) SDA" -- (A4). Do I need to use a different "I2C Init" or is using this one okay?
06-03-2015 11:45 AM
First you need to be clear what code you are runing on the Arduino. Is it your own code that you have shown or is it the LIFA code?
06-03-2015 01:55 PM
Thank you for replying, but it's been too problematic trying to interface the Arduino Uno and LabVIEW. I'm just going to try to use a different program such as Matlab.
06-03-2015 03:30 PM
What makes you think that you can do better with Matlab, a program for calculations?
06-04-2015 09:57 AM
I'm going to actually try it out later and I'll let you know if it works. But here's the link I found, it's only a few lines of code to get the data from Arduino into Matlab:
http://allaboutee.com/2011/07/04/how-to-send-data-from-the-arduino-to-matlab/
I tried making LabVIEW work with the Arduino for hours and I just could not get it to work so I figured Matlab was at least worth a shot.