Quote:
Originally Posted by Nameless
Is it possible to attach an interrupt to a digital input on the driver station? I would like to use an encoder as an input device, and I don't believe there is any other way use them than with interrupts. I looked through the WPILib beta 5 code and didn't see anything about driver station interrupts in DriverStation.h/cpp and FRCComm.h.
If this isn't possible, I'm considering using a microprocessor to take in the encoder readings, keep track of the encoder offset, and output that as a PWM signal to the driver station analog input. For example, if the encoder is turned halfway around, the microprocessor would send a 50% PWM to the driver station. Would this work correctly? Also, does the driver station have a power source I could use? (As I understand it, external power is not allowed.)
For the visual people:

|
You would have to put a low pass filter on your PWM signal for the analog input to read it properly. If you post the specific frequency you will be duty cycle modulating, we can help you design the filter. It won't be much more than an RC network or two.
There is a 5V power supply on the DS that you can use, it is set up just like the DSC.