|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Tweaking PWM output period for dimming LEDs
I've previously used PWM.setRaw() to set the duty cycle of PWM channels for driving LEDs, where setRaw(0) is 0% duty cycle and setRaw(255) is 100%.
|
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
Re: Tweaking PWM output period for dimming LEDs
Chris
How many LED's are you trying to drive? If you are driving multiple LED's, are they connected in series? How many are connected in series? |
|
#4
|
|||
|
|||
|
Re: Tweaking PWM output period for dimming LEDs
Thanks guys, I'm taking a look at those methods now.
As for the number of LEDs, its one of the ubiquitous RGB LED strips. If you're working toward the usual warning about current draw on the PWM pins, I'm quite aware, hence the transistor amp. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|