FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino

We purchased an AndyMark light package part number am-2645.  We want to control the LEDs based off of the robot's actions (i.e. blue when shooting or light chasing red when moving).

We are having trouble communicating with the arduino using the arduino library. We have a Atmega microcontroller but the only board options are and Uno, a Dimuelanove w/ Atmega 328, and Mega 2560. However, we are running a Atmega 328 independently. How can we communicate with the cRio hardware wise and software wise? Please help!

0 Kudos
Message 1 of 3
(5,042 Views)

I recommend I2C.  Look at the examples and search the forums.

0 Kudos
Message 2 of 3
(3,176 Views)

FRC418 purchased the exact same thing.  We considered using I2C, but instead decided we weren't developing a SpaceX rocket module - we were controlling lights for crying out loud.  Our "Illumination Team Lead" used relay ports on the DigitalSidecar (since we were only using one relay port for our compressor) to feed into DIO ports on the Arduino.  The code on the cRIO triggered a relay when we did specific tasks (we had a different relay signify a different "function" (such as shoot, etc...) within Periodic Loops (which is where our task queue was processed).  The Arduino then separately polled the DIO lines and when it saw a specific pattern would control the lights accordingly.  This allowed us to also isolate the cRIO from the Arduino, so if the Arduino disappeared we wouldn't care or know otherwise.  It also allowed the Arduino to be tested outside the cRIO, we didn't need to tie down the cRIO to develop our lighting - that was probably our major core directive for lights on the robot, it could not impact development on the robot AT ALL.

-Danny

0 Kudos
Message 3 of 3
(3,176 Views)