View Single Post
  #4   Spotlight this post!  
Unread 29-01-2015, 21:53
Bonzabonz Bonzabonz is offline
Registered User
FRC #5052 (RoboLobos)
Team Role: Alumni
 
Join Date: Feb 2014
Rookie Year: 2014
Location: Cedar Park Texas
Posts: 13
Bonzabonz is an unknown quantity at this point
Re: Tweaking PWM output period for dimming LEDs

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.