My team had to do the same thing; there are functions to get a DIO pin to output a PWM signal of a user specified frequency. We did it using LabVIEW, but it should work in a similar way using Java or C++. If you just need to open the DIO pin as normal, you can use the
Gen PWM VI to set your duty cycle. There is an additional VI abbreviated
Config PWM Rate where you can actually change the frequency of the signal for the DIO pin.
I was also able to find documentation for the Java
DigitalOutput class here:
http://first.wpi.edu/FRC/roborio/rel...e4aab985133c41 . There are
setPWMRate(),
enablePWM() and
updateDutyCycle() methods to control the PWM functionality for a specific DIO pin. The API should have more details on how to implement them.