|
Re: WPILib and Eclipse
I haven't tried using the Interrupt Watchers yet - I've got bumper switches working on my vExbot just by calling GetDigitalInput( ) inside my main program loop. Yes, it's possible that I'll miss the "press" event, but I've actually got very little code running in the loop right now, and besides, I'm just using the switches to determine if I've driven into a wall, so the "press" is fairly certain to be longer than a program loop cycle. Perhaps Brad can chime in here on the "gotchas" for Interrupt Watchers?
As for your second question, I think you mean you want to get the "joystick" values from the OI, and use those to set the PWMs, correct? Here you would use another "undocumented" function - GetRxInput(port, channel), which returns a value between 0 and 255. You can then map that directly to the PWM of your choice using SetPWM( ). (There's also a GetPWM() function, but it's only available on the vEx, and I'm not quite sure what you would use it for anyway?)
Note also these additional "undocumented" functions available for reading values from the OI:
unsigned char GetOIDInput(unsigned char port, unsigned char channel);
unsigned char GetOIAInput(unsigned char port, unsigned char channel);
(where, if it's not obvious, "D" = digital, "A" = analog).
|