pi4j-v2
pi4j-v2 copied to clipboard
Software PWM fails to work on Pi 1
Yes, I still have an original Pi 1.
I'm porting the last piece of my Pi4J v1 software to the latest v2.3.0. It all works apart from the software PWM.
I set it up as follows:
final PwmConfig config = PwmConfigBuilder.newInstance (ctx)
.id ("BCM17")
.name ("PWM")
.address (17)
.pwmType(PwmType.SOFTWARE)
.initial (50)
.provider ("pigpio-pwm")
.shutdown (0)
.build ();
pwm = ctx.create (config);
pwm.on ();
And then move from the initial 50% duty cycle. I can print out the values of pwm.actualFrequency(), pwm.address(), pwm.dutyCycle() and pwm.isOn () and they seem to change fine.
However, it appears that the output pin is just left floating!
Any ideas? Setting the id to BCM17 was something else I found in the issues, but that doesn't seem to have helped.