Open
Description
Hi!
I'm doing PWM but I cannot see any PWM signal when I try to connect.
I'm set the duty cycle the PWM with
pwm0.setDutyCycle(do0/ControlView.MAX_SLIDER_VALE);
And the PWM decleration looks like this:
// This will turn on/off the FQP30N06L MOSFET
private Pwm createDigitalPWMOutput(int pinOutput, Context pi4j, String id) {
try {
// use try-with-resources to auto-close I2C when complete
PwmConfig config = Pwm.newConfigBuilder(pi4j)
.id(id)
.name("PWM Pin output")
.address(pinOutput)
.pwmType(PwmType.SOFTWARE)
.frequency(pwmFrequency) // optionally pre-configure the desired frequency to 1KHz
.dutyCycle(0) // optionally pre-configure the desired duty-cycle (50%)
.shutdown(0) // optionally pre-configure a shutdown duty-cycle value (on terminate)
.initial(0) // optionally pre-configure an initial duty-cycle value (on startup)
.build();
Pwm pwm = pi4j.providers().get(PiGpioPwmProvider.class).create(config);
pwm.on();
return pwm;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
The pwmFrequency
is 100
Metadata
Metadata
Assignees
Labels
No labels