Big Picture Thought first: If you are intending to control a jointed arm, it might make more sense to use potentiometers and the analog inputs on the Launchpad instead of quadrature encoders. You wouldn't have to modify the default FRC Launchpad code to do that. You could just go directly to the Ax, Ay, Az etc. inputs.
Quote:
Originally Posted by KMBruggeman
I figured since I could see the buttons lighting up at the bottom of the driver station and in my custom dashboard I should be able to read that input without actually running "main.vi" to either a live robot or a simulated robot (to help out my old and wheezing processor).
|
Right, the encoders will still be "live" even if the roboRio code is not running, and you should see flashing virtual LEDs on the DS corresponding to the buttons that have been "stolen" for the encoder (unless you remove them from the "raw" button datastream, which we didn't). We've found that seeing the button states is very useful for diagnostic purposes.
Quote:
|
I'm not seeing the button outputs though and when I tried to tie into the data stream that is on the standard dashboard project I was not getting anything from the Launchpad.
|
That sounds consistent with previous years then; you'd may have to transmit that data back to a Custom Dashboard from the roboRIO using the Smart Dashboard/Network Table feature.
Quote:
|
1 - Can I tell what software is actually loaded on the Launchpad? (Validate the software install) Currently when I use the little debug button I am getting HW stops where I have a steady red LED and I have to restart the Launchpad via unplugging/plugging it in.
|
Perhaps a breakpoint is set? Unlike the roboRIO, code on the Launchpad doesn't/can't run in RAM - just Flash memory. Whenever you hit Debug, it's overwriting the old Flash contents with the new. About the only way to know what's currently loaded into Flash would be via the checksum.
Quote:
|
2 - Is the Launchpad actually calculating a value for "encoder_count" and what is it? (Can I see this by using a tool in CCS?)
|
In theory you should be able to see the value using the Variables tab in Debug mode, but for some reason that didn't work for us (even thought it's declared as a STATIC). What you might try instead is setting breakpoints at places of interest within the ISR to see what it "thinks" it's doing.
Quote:
|
Could I see this on my laptop with another tool? I would guess that I could use the LabView Custom Dashboard for this
|
Dunno, sorry.
Quote:
|
Also if I wanted to use say P1.3 and P1.2 would I need to delete them from the "Indicators" section of "OPTION1" in hal.c and replace two of the dummy inputs after P1.4 in the buttons section?
|
I don't have the info re: the original OPTION1 configuration handy at the moment, but in general yes - if OPTION1 configures those as outputs (indicators) they you'd need to change them to inputs (buttons) instead. Maybe that's what's going wrong.
I've got your email address; I'll try to drop you a line later tonight. It might be best if you .zip up your code for me to take a look at. I'll bring a Launchpad and two encoders home to work with.