View Single Post
  #6   Spotlight this post!  
Unread 04-03-2015, 12:10
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,356
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Arduino Leonardo ++ Driver Station Output

Quote:
Originally Posted by wt200999 View Post
The intent with the new driverstation is to support HID gamepads as the 'obvious' way to communicate from the robot to the driver station, and a HID compatible microcontroller or a gamepad can be used to get custom input/output. This year's WPILib API has functions to set outputs to the driver station which is communicated directly to the joystick.

The HID compatible Arduinos, like the Leonardo++, will work for inputs by default, however the libraries do not have support for HID outputs, meaning out of the box you would not be able to set indicator LEDs. The underlying software would need to be modified to add this support.

The LaunchPad in the kit can be loaded with prebuilt binaries to support input and outputs out of the box. So you can connect it to the driver station and hook both buttons and indicator LEDs to the board, and use the WPILib API to turn on/off the LEDs. The only downside is that if you want to edit the code the only option is the full eclipse based Code Composer. The Arduino forked environment for the LaunchPad (Energia) doesn't work for HID. ....

I set the text to bold that I wanted to make sure wasn't missed.

This is how we created our drives station "Button Box" this year.
The Launchpad has 3 different possible configurations right from the KOP.
The differences in the 3 configurations are based on how many inputs vs. outputs that are available. The combinations of I/O are: 11/11, 16/6, 20/2.
All 3 combinations also have 8 analog inputs.

As an example, we started out needing 18 inputs (later refined to only 14) from our button box. So, the configuration we chose was 20/2.
We the used the 2 outputs to interface to a Arduino Nano inside the button box to control a string of 60 WS2812 LEDs.

While the robot is disabled, output 1 and 2 remain low. This tells the Adruino to run a demo loop that just cycles through a variety of lighting patterns.
Once the robot goes enabled, output 1 goes high. The Arduino then looks at output 2 to determine which pattern to display. Output 2 HIGH means Red Alliance, LOW means Blue Alliance. The LEDs then just display the Alliance color.

This is a very simple use of the outputs to drive LEDs. Discrete LEDs can also be driven directly by the Launchpad, but care must be taken to not exceed the current ratings of the board.

Here is a very helpful web page to help you figure out how to use your Launchpad.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist