Hi. Our team for the preseason is trying to use an arduino to control leds based on what buttons we press on the remote. I read somewhere that some teams do this through DIOs on the roborio to arduino. How would I code this in Labview? What do I need to code on the Arduino to make it work?
You would write to digital outputs in LabVIEW on the roboRIO and then read them in using digital inputs on the Arduino. The more DIO pins you relegate for this task, the more distinct color states you can choose (2^n different states).
You might be able to use a DIO to output a PWM signal, then read that signal with the arduino. (Or if you can spare a PWM port, you could use that). This would give you many more options for colors without tying up a bunch of outputs.
Here is some code to read PWM with the arduino (I haven’t tried it, but I have done something similar with an adruino). https://gist.github.com/ivarvong/8202180
For the labview code you can probably use Pulse.vi. (Page 22-4 in this document, the newer version of labview should have an equivalent vi: http://www.ni.com/pdf/manuals/372668d.pdf).
i would suggest using i2c to talk to the Arduino This is what we did last year and it worked great. The other great things about this is you will not use up your DIO on the roborio and you can have a lot more features.