No hardware PWM's on all GPIO
See original GitHub issueHi!
Just started with Pi4J 2.0 and I got an error.
2020-07-10 15:44:02 gpioHardwarePWM: bad gpio for PWM (3)
[http-nio-8080-exec-5] WARN com.pi4j.library.pigpio.impl.PiGpioNativeImpl - PIGPIO ERROR: PI_NOT_HPWM_GPIO; GPIO has no hardware PWM
And the Java code:
// This will turn on/off the FQP30N06L MOSFET
private Pwm createDigitalPWMOutput(int pinOutput, Context pi4j) {
try {
// use try-with-resources to auto-close I2C when complete
PwmConfig config = Pwm.newConfigBuilder(pi4j)
.id("my-pwm-pin")
.name("My Test PWM Pin")
.address(pinOutput)
.pwmType(PwmType.HARDWARE)
.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;
}
I call that function with:
Context pi4j = Pi4J.newAutoContext();
Pwm pwm0 = createDigitalPWMOutput(3, pi4j);
That’s weird because Pigpio says that there are 0-31 hard ware PWM’s http://abyz.me.uk/rpi/pigpio/
Issue Analytics
- State:
- Created 3 years ago
- Comments:42 (11 by maintainers)
Top Results From Across the Web
Pigpio PWM - Raspberry Pi Forums
hardware timed PWM on all of GPIO 0-31. I need 3 GPIO's with precise PWM ... The error states pigpio.error: 'GPIO has no...
Read more >Pulse Width Modulation for Dummies-Raspberry Pi GPIO ...
A hardware PWM pin is controlled by a channel. The PWM Clock, range, and pulse width are specified for a channel. All hardware...
Read more >Writes average PWM voltage to a GPIO pin - MathWorks
The PWM uses a software implementation allowing all GPIO pins on the Raspberry ... This argument does not accept vectors because the hardware...
Read more >23. API - Pins — GPIO Zero 1.6.2 Documentation
GPIO library installed, (assuming no environment variables are set), the default pin factory ... Supports all features including PWM (hardware via DMA).
Read more >troubles with bcm2835 hardware PWM
And back to bcm2835 lib. Yes, its a very old lib, but it still updates. My interest in RPI GPIO programming not only...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@DanielMartensson ,
Please try again. I have deployed the latest version (with the signal fix) to the Maven SNAPSHOT repository now.
You may want to first delete the directory and files on your local system where this JAR file could be cached to ensure the new version is picked up by Maven.
This will help. https://github.com/DanielMartensson/OpenSourceLogger
@savageautomate @FDelporte