|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
||||
|
||||
|
Hi guys,
I have been working on building a robot and have chosen an arduino mega to function as my I/O board. As my role in the team concentrates mainly on building, I am lost when it comes to programming the darn thing. I have mastered programming the arduino, using the native language (something akin to C++), but have yet to be successful in controlling it remotely. My dilema centers around my inability to write a dashboard program. I would like to know how to send serial data (in the form of numbers) to the arduino using LabView. Thanks in advance for any advice that you give. |
|
#2
|
|||||
|
|||||
|
Re: Sending commands to an arduino
I don't have an answer for you, but the Arduino Mega supports I2C, and the Digital Sidecar also speaks I2C. Similarly, the cRio speaks Serial Data (RS-232 I believe) as does the Mega (but you may need a simple lever converter like a MAX202)
Labview, by itself, can't speak to anything. It's software. I assume you mean to use the FRC hardware (cRio) to communicate with the Mega? The trick then is to find the command block for data communications, address it to the correct port (I2C, Serial, etc) and then all you do is squirt your data in and listen for what comes out. Have to do that on the 'duino too. There's lots of info for the Arduino side of this; Google it. |
|
#3
|
||||
|
||||
|
Re: Sending commands to an arduino
Processing (www.processing.org) is sort of like the arduino's computer-side counterpart. The languages are virtually the same, and there's a wealth of information online about building interfaces with it, and communicating with the arduino either by serial, or (with an ethernet shield on the arduino) TCP/IP (standard networking protocol). Processing itself is java based, and cross platform, just like the arduino IDE.
|
|
#4
|
||||
|
||||
|
Re: Sending commands to an arduino
I like your idea about using processing... i'l give that a try.
Thanks to both of you. ![]() |
|
#5
|
|
Re: Sending commands to an arduino
There is also this:
https://decibel.ni.com/content/group...ce-for-arduino Labview interface for Arduino. I have not tried it yet, but it looks interesting. |
|
#6
|
|||||
|
|||||
|
Re: Sending commands to an arduino
Quote:
|
|
#7
|
||||
|
||||
|
Re: Sending commands to an arduino
Thanks guys, I have it figured out.
Ill use processing and the Serial I/O library. |
|
#8
|
||||
|
||||
|
Re: Sending commands to an arduino
I've been looking into this same problem. We'd like to use Arduino's to control our old robots rather than buying new cRIOs each year.
I've got all the aspects of using the Arduino to control all of our 2010 Breakaway robots functions. That part took a bit but now works well. I have attached a Joystick shield to my Arduino and can run the robot quite nicely. Now I've got to figure out a way to interface the Arduino. I would PREFER to use either an Ethernet Shield attached to the robot modem, or using a WiFi Shield ($$$). Then comes the herculean task of figuring out how to receive the commands from the LabView Program on the drive station, interpret them in the Arduino, and run the robot. The good news is at least initially, all I need to do is make the connection from a laptop to the Arduino. If I can do that, I can use a variety of programs to make my own "drive station" and worry about the LV drive station interaction later. If anyone has figured out how to make the Arduino "wireless" and allow it to accept commands from from a separate laptop? Doc |
|
#9
|
||||
|
||||
|
Re: Sending commands to an arduino
Quote:
We used the 2009-2010 wireless bridge, since we could "borrow" it from an FRC team, an Arduino Mega 2560 and an ethernet shield. The robot code unfortunatly is not compatible with the official driver station. This is due to the fact that the Arduino could not read the data from the shield fast enough. We used the FRC protocol, but had to reduce the user data sizes such that the total packet size was under 128 bytes, vs the FRC 1024 bytes. We never tested the limits of the ethernet shield other than that it couldn't do 1024 bytes/packet, but could do 192 bytes/packet. We shrank the packets to 128 bytes for saftey once we knew the size of our user data. We speculated that it would be possible to support the offical packet size, but it would require significant improvments to the Arduino ethernet library. We opted for the quicker option. The driver station should be compatible with an FRC robot, but I never tested it with a real cRio. If you try to use any of this, and have issues please contact me. DISCLAIMER: This worked for us, but it is lacking some of the saftey features of the official cRio/DS. Some of the safties I left out were probably there for good reason. I take no responsiblity for anything you do with this code. You can find the code from this project on Google Code. Search for "SCOE". |
|
#10
|
||||
|
||||
|
Re: Sending commands to an arduino
I love your drivers station (and the fact that it works with arduino). I would like to know the guidelines that would allow me to retrieve the data packets that are sent from the DS to the arduino (using the native arduino language, if possible).
Just warning you... NOOB PROGRAMMER ALERT!!! this is my first large scale project that I have done. Just bear with me and all of my stupid questions ![]() |
|
#11
|
||||
|
||||
|
Re: Sending commands to an arduino
Quote:
Arduino Wifi Control Source Code The code is linked at the bottom of the page. The robot side code is simply interpreting signals sent from the driver side via wifi.....and signals sent via wifi could be interpreted with some modifications. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|