Quote:
Originally Posted by majesticfish
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
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.