View Single Post
  #7   Spotlight this post!  
Unread 05-03-2015, 11:52
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 325
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Arduino Leonardo ++ Driver Station Output

Quote:
Originally Posted by majesticfish View Post
How specifically would I be able to send information using smart dashboard to the serial on the arduino?
Assuming you've used or know how to use smart dashboard, you need a way to communicate through serial to the arduino in LabVIEW. Two good methods I can think of to use for this.

The first one is what reuven mentioned in the post above. The LVH-LINX library is a neat library which puts a generic firmware image on the arduino, and uses the serial port to access the pariphrials on the device. It is not as fast as writing code directly on the arduino, but it makes the interface easier. Before the season started I had LINX working on the LaunchPad as well, and the timing between commands was close to ~5ms. So its great for low speed tasks. I'm also not sure that you would be able to use this AND the HID protocol with the driver station.

The second method would be to do all the programming on the ardunio/LaunchPad and send data back data through the serial port using the standard 'Serial.Print()' commands. On the LabVIEW side you can use the built in serial port functions found at Instrument I/O --> Serial. From here you just need to interpret the data you sent from the arduino and convert it to send over the smartdashboard. I don't know if you can do both this AND the HID protocol on the arduino, however the LaunchPad has a built in USB hub which allows it to use the serial port AND the HID at the same time.

Quote:
Originally Posted by fovea1959 View Post
wt200999: what's the wpilib class and method to manipulate HID leds on the driver station?
For both C++ and Java the Joystick class has:

Joystick.setOutput(uint8_t outputNumber, bool value)
Set a single HID output value for the joystick.

Parameters
outputNumber The index of the output to set (1-32)
value The value to set the output to

and

Joystick.setOutputs(uint32_t value)
Set all HID output values for the joystick.

Parameters
value The 32 bit output value (1 bit for each output)

More details here

In LabVIEW its under WPI Robotics Library --> Joystick --> Set Outputs which gives an array of booleans as the input.

You can test this by setting the first two outputs to true, and you should see two indicator lights on the LaunchPad itself light up.
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -