From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Switching between Arduino and LabVIEW

Hello everyone, 

 

I have a question about a project we have to do for school. We have to build a linefollowing robot, which also uses a RGB sensor and a distance sensor. We use the Arduino Uno for this project and the code for Arduino is almost ready. But another function of the robot is that it has to be possible to control the robot with a LabVIEW program on our laptop (by using Bluetooth). The intention of this function is that we can take over control of Arduino when it does something wrong (for example, to avoid a collision). LabVIEW is new for us, so a little help would be nice. 

 

In the LabVIEW program I use the event-structure. For the moment, I have 5 events: Forward, TurnLeft, TurnRight, Stop and another event to stop the whole labVIEW program. They all have a boolean and when the value change, the correspending event is performed by the robot.

 

But I have a question about changing the control between LabVIEW and Arduino. How should I do this? I think I will probably have to make another event with a boolean and value change? For example: when the robot is controlled by the code in Arduino and I push the boolean button, the control goes to LabVIEW and vice versa. But only a boolean won't be enough, so what do I have to do for this? 

 

Many thanks

0 Kudos
Message 1 of 6
(2,614 Views)
You probably need to start with some basic computer skills. Posting a 5MB file is ridiculous. Why use a camera? Don't you know how to do a print screen on the pc?
0 Kudos
Message 2 of 6
(2,602 Views)

You're totally right.. I hadn't seen the file was 5MB. I attached a smaller one here. 

0 Kudos
Message 3 of 6
(2,587 Views)

Here is the smaller image

0 Kudos
Message 4 of 6
(2,584 Views)
Thank you, much better.

I'm not that familiar with arduino code but another button and event might not be necessary. If you can generate an interrupt when it receives one of your commands, then the arduino code could switch to manual mode for just that command.

To completely disable autonomous mode, then yes you could have a button but again it would require the arduino to constantly monitor the serial port and stop your arduino. I'm sorry but I can't help with the c code. Why do you think the LabVIEW code requires more than a Boolean?
0 Kudos
Message 5 of 6
(2,569 Views)

I've played with Arduinos a bit. Just take a look at the basic serial command sketch that ships with the IDE. You can use that and poll for a serial command without stalling your arduino loop.

0 Kudos
Message 6 of 6
(2,558 Views)