LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuously read data from one arduino, and send data to another arduino, w/ labview

Hello,
I am currently working on a project where I read in the sound value from an arduino into labview. I then interpret the signal and based on what it is, I then send an integer to another arduino, in order to have that one send an ir blast to a tv. It is essentially supposed to control the volume of the tv.

 

I initially had been using one arduino to do both jobs, but when labview sent the signal to the arduino, telling it to adjust the volume, then the continuous stream of sound values that it was sending back, would stop momentarily. And them stopping slowed the system down and it didn't really work. So I needed to have a continuous stream of data, so I then tried to hook up two arduinos. One to write to labview (the mic level), and one to read from labview (an integer 0, 1, 2, for do nothing, increase volume, decrease volume).

 

I am having trouble getting labview to use two arduinos.

 

I understand that labview is not the best way to do this, but I need to use it for the project.

 

So all in all, I need to find a way for labview to communicate with two arduinos, one for writing, and one for reading.

 

My arduino write code seams to be working fine. My read code (for reading what do to from labview), might not be correct. Labview sends a integer in the form of a string, then the arduino parseInt()s it and makes it an integer. I then just use a simple == to see what it was, and then either send an ir blast or not. This is a separate problem though. We could try to solve the above problem first. The only possible issue here is reading the string from labview. I know that the sending of an ir blast works.

 

 

About the attachments:
The labview file:
So this is a dumbed down version of what I currently have. I deleted a bunch of stuff just so someone else could get the general idea of what I am doing. I currently have two while loops. One for writing to one arduino, and one for reading to one arduino. They were in one originally but that wasn't working, so I tried two. They can go back into one if that would work better.

 

So pretty much, the top while loops reads in the volume level, and then based on that will set one of three booleans to true. Either increase volume, decrease, or do nothing. Then one those three case structures will be opened, and then set the value to be sent to the arduino to a single number. (the arduino should be able to read the number and decide to increase or decrease volume).


Then in the bottom while loop, this is to send to the arduino. If that case structure in there is true, it will send whatever the arduinosend value currently is (which was set depending on the top while loop and the outputting volume).

 

I can't get them to both work together, the program stops reading in from the one arduino when the second one is hooked up. When only the microphone one is then it will continuously read the value.


I know that I need to only send one signal at a time, and then close the case statement so it doesn't continuously send the value to the arduino. But for now I just want to know if I am correctly using two arduinos.

 

The arduino code is also attached. One is uploaded to the microphone arduino, one is uploaded to the ir send arduino.

 

Any help would be appreciated!

 

p.s. cannot attach arduino sketches, they don't need to be addressed now though

0 Kudos
Message 1 of 1
(3,105 Views)