Active project?
Robert Savage
robert at savage7.com
Thu Nov 12 11:47:07 UTC 2015
Hi Jeff,
You should be able to use PWM with Pi4J.
Simple hardware PWM example:
package gpio.test;
import com.pi4j.io.gpio.GpioController;
import com.pi4j.io.gpio.GpioFactory;
import com.pi4j.io.gpio.GpioPinPwmOutput;
import com.pi4j.io.gpio.RaspiPin;
public class PwmTest {
/**
* @param args the command line arguments
* @throws java.lang.InterruptedException
*/
public static void main(String[] args) throws InterruptedException {
GpioController gpio = GpioFactory.getInstance();
GpioPinPwmOutput pwm = gpio.provisionPwmOutputPin(RaspiPin.GPIO_24);
pwm.setPwm(500);
// keep program running until user aborts (CTRL-C)
for (;;) { Thread.sleep(500); }
}
}
Thanks, Robert
On Wed, Nov 11, 2015 at 11:55 PM, Jeff Prestes <jeffprestes at gmail.com>
wrote:
> Hey Andrew,
>
> I've tried but using dio or Pi4J I couldn't simulate a PWM.
>
> Best,
>
> -Jeff
>
> On Wed, Nov 11, 2015 at 5:21 PM, Andrew Penhorwood <andrew at coldbits.com>
> wrote:
>
> > Is this project active? I was hoping for some pointers on how to do PWM
> > with the raspberry PI.
> >
> > --
> > Andrew Penhorwood
> >
> >
>
More information about the dio-dev
mailing list