Replies: 1 comment 1 reply
-
I believe the dout().create() creates the output pin with no operational provider. I did not see a means to add a valid provider using that pattern so I changed your code as seen below, the LED blinks and remains ON at completion. I did not have your logging class so I modified the code to use the console. Also, for my clarification, you refer to pin 16, which is BCM16, pin 36.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I have a problem: nothing happens when I run the program below:
`package gc.services.blink;
import com.pi4j.Pi4J;
import com.pi4j.io.gpio.digital.DigitalState;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.TimeUnit;
@slf4j
public class Main {
}
`
this is my pom:
`
4.0.0
`
I compile the code on a windows 10 machine, then I run the code on my Raspberry -> Raspberry Pi 4 Model B Rev 1.2
java -version -> openjdk version "17.0.1" 2021-10-19 LTS
I connected on the bcm pin 16 a jumper to a resistor (220 Ohm) in series with a red 2.1V led. Another jumper from the led cathode to the ground.
Nothing happens, this is the log:
08:53:34.888 [main] INFO com.pi4j.Pi4J - New auto context
08:53:34.889 [main] INFO com.pi4j.Pi4J - New context builder
08:53:35.289 [main] DEBUG com.pi4j.runtime.impl.DefaultRuntime - Pi4J runtime context successfully created & initialized.'
08:53:35.569 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - added io to managed provider map [id=raspberrypi-pwm; name=RaspberryPi PWM Provider; class=com.pi4j.plugin.raspberrypi.provider.pwm.RpiPwmProviderImpl]
08:53:35.615 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - added io to managed provider map [id=pigpio-spi; name=PiGpio SPI Provider; class=com.pi4j.plugin.pigpio.provider.spi.PiGpioSpiProviderImpl]
08:53:35.665 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - added io to managed provider map [id=raspberrypi-i2c; name=RaspberryPi I2C Provider; class=com.pi4j.plugin.raspberrypi.provider.i2c.RpiI2CProviderImpl]
08:53:35.713 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - added io to managed provider map [id=pigpio-digital-output; name=PiGpio Digital Output (GPIO) Provider; class=com.pi4j.plugin.pigpio.provider.gpio.digital.PiGpioDigitalOutputProviderImpl]
08:53:35.748 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - added io to managed provider map [id=pigpio-serial; name=PiGpio Serial Provider; class=com.pi4j.plugin.pigpio.provider.serial.PiGpioSerialProviderImpl]
08:53:35.786 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - added io to managed provider map [id=raspberrypi-digital-input; name=RaspberryPi Digital Input (GPIO) Provider; class=com.pi4j.plugin.raspberrypi.provider.gpio.digital.RpiDigitalInputProviderImpl]
08:53:35.815 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - added io to managed provider map [id=raspberrypi-serial; name=RaspberryPi Serial Provider; class=com.pi4j.plugin.raspberrypi.provider.serial.RpiSerialProviderImpl]
08:53:35.842 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - added io to managed provider map [id=raspberrypi-spi; name=RaspberryPi SPI Provider; class=com.pi4j.plugin.raspberrypi.provider.spi.RpiSpiProviderImpl]
08:53:35.880 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - added io to managed provider map [id=raspberrypi-digital-output; name=RaspberryPi Digital Output (GPIO) Provider; class=com.pi4j.plugin.raspberrypi.provider.gpio.digital.RpiDigitalOutputProviderImpl]
08:53:35.919 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - added io to managed provider map [id=pigpio-digital-input; name=PiGpio Digital Input (GPIO) Provider; class=com.pi4j.plugin.pigpio.provider.gpio.digital.PiGpioDigitalInputProviderImpl]
08:53:35.955 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - added io to managed provider map [id=pigpio-i2c; name=PiGpio I2C Provider; class=com.pi4j.plugin.pigpio.provider.i2c.PiGpioI2CProviderImpl]
08:53:35.989 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - added io to managed provider map [id=pigpio-pwm; name=PiGpio PWM Provider; class=com.pi4j.plugin.pigpio.provider.pwm.PiGpioPwmProviderImpl]
08:53:35.990 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - providers loaded [12]
08:53:35.991 [main] INFO c.p.p.impl.DefaultRuntimePlatforms - adding platform to managed platform map [id=raspberrypi; name=RaspberryPi Platform; priority=5; class=com.pi4j.plugin.raspberrypi.platform.RaspberryPiPlatform]
08:53:35.993 [main] DEBUG c.p.p.impl.DefaultRuntimePlatforms - default platform is now [id=raspberrypi; name=RaspberryPi Platform; class=com.pi4j.plugin.raspberrypi.platform.RaspberryPiPlatform]
08:53:35.994 [main] DEBUG c.p.p.impl.DefaultRuntimePlatforms - platforms loaded [1]
08:53:35.995 [main] DEBUG com.pi4j.runtime.impl.DefaultRuntime - Pi4J context/runtime successfully initialized.'
08:53:35.996 [main] DEBUG com.pi4j.context.impl.DefaultContext - Pi4J runtime context successfully created & initialized.'
08:53:35.996 [main] DEBUG c.p.c.impl.DefaultContextBuilder - Pi4J successfully created and initialized a new runtime 'Context'.'
08:53:36.171 [main] INFO gc.services.blink.Main - CURRENT DIGITAL OUTPUT [@DOUT-16 "DOUT-16" (#16)] STATE IS [
08:53:36.209 [main] INFO gc.services.blink.Main - LOW]
08:53:36.210 [main] INFO gc.services.blink.Main - PULSING OUTPUT STATE TO HIGH FOR 3 SECONDS
08:53:39.211 [main] INFO gc.services.blink.Main - PULSING OUTPUT STATE COMPLETE
08:53:39.216 [main] DEBUG c.p.p.impl.DefaultRuntimePlatforms - removed platform from managed platform map [id=raspberrypi; name=RaspberryPi Platform; class=com.pi4j.plugin.raspberrypi.platform.RaspberryPiPlatform]
08:53:39.233 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - removed provider from managed provider map [id=pigpio-spi; name=PiGpio SPI Provider; class=com.sun.proxy.$Proxy1]
08:53:39.234 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - removed provider from managed provider map [id=pigpio-pwm; name=PiGpio PWM Provider; class=com.sun.proxy.$Proxy11]
08:53:39.236 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - removed provider from managed provider map [id=raspberrypi-spi; name=RaspberryPi SPI Provider; class=com.sun.proxy.$Proxy7]
08:53:39.237 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - removed provider from managed provider map [id=raspberrypi-digital-output; name=RaspberryPi Digital Output (GPIO) Provider; class=com.sun.proxy.$Proxy8]
08:53:39.238 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - removed provider from managed provider map [id=raspberrypi-digital-input; name=RaspberryPi Digital Input (GPIO) Provider; class=com.sun.proxy.$Proxy5]
08:53:39.239 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - removed provider from managed provider map [id=pigpio-i2c; name=PiGpio I2C Provider; class=com.sun.proxy.$Proxy10]
08:53:39.240 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - removed provider from managed provider map [id=pigpio-digital-output; name=PiGpio Digital Output (GPIO) Provider; class=com.sun.proxy.$Proxy3]
08:53:39.254 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - removed provider from managed provider map [id=raspberrypi-i2c; name=RaspberryPi I2C Provider; class=com.sun.proxy.$Proxy2]
08:53:39.256 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - removed provider from managed provider map [id=pigpio-serial; name=PiGpio Serial Provider; class=com.sun.proxy.$Proxy4]
08:53:39.257 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - removed provider from managed provider map [id=raspberrypi-pwm; name=RaspberryPi PWM Provider; class=com.sun.proxy.$Proxy0]
08:53:39.258 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - removed provider from managed provider map [id=raspberrypi-serial; name=RaspberryPi Serial Provider; class=com.sun.proxy.$Proxy6]
08:53:39.259 [main] DEBUG c.p.p.impl.DefaultRuntimeProviders - removed provider from managed provider map [id=pigpio-digital-input; name=PiGpio Digital Input (GPIO) Provider; class=com.sun.proxy.$Proxy9]
08:53:39.260 [main] DEBUG com.pi4j.runtime.impl.DefaultRuntime - Pi4J context/runtime successfully shutdown.'
Any help will be appreciated :)
Beta Was this translation helpful? Give feedback.
All reactions