Closed savageautomate closed 4 years ago
I realize the Pi4J examples in some cases reference an explicit provider, but we probably should not (except for in test cases) to allow for any IO provider to be provided at runtime.
So, in this project, I would change:
To:
I2CProvider i2CProvider = pi4j.i2c();
This should use the default I2C provided as detected by the Pi4J framework.
Thanks! How about this one?
Pwm pwm = pi4j.providers().get(PiGpioPwmProvider.class).create(config);
I got this examples from Deporte.
@savageautomate
I realize the Pi4J examples in some cases reference an explicit provider, but we probably should not (except for in test cases) to allow for any IO provider to be provided at runtime.
So, in this project, I would change:
To:
I2CProvider i2CProvider = pi4j.i2c();
This should use the default I2C provided as detected by the Pi4J framework.
@savageautomate
I think this is a bug, because now the digital input does not work at all. Have a look:
I realize the Pi4J examples in some cases reference an explicit provider, but we probably should not (except for in test cases) to allow for any IO provider to be provided at runtime.
So, in this project, I would change:
To:
I2CProvider i2CProvider = pi4j.i2c();
This should use the default I2C provided as detected by the Pi4J framework.
@savageautomate
Sorry. Your advise did not work. I need to use the string provider.
It must be a bug then, it's supposed to work. The Pi4J framework should auto-assign a default provider, in this case an I2CProvider
in runtime at startup.
It must be a bug then, it's supposed to work. The Pi4J framework should auto-assign a default provider, in this case an
I2CProvider
in runtime at startup.
@savageautomate
Yes. Also you should check out the PWM class as well. I can't measure 3.3 volt as output when I have 100% duty call. Check out my IO.java class in this project.
Input and I2C works if I have the string provider argument.
I realize the Pi4J examples in some cases reference an explicit provider, but we probably should not (except for in test cases) to allow for any IO provider to be provided at runtime.
So, in this project, I would change:
https://github.com/DanielMartensson/OpenSourceLogger/blob/f6ee79838ea634a46ada029cf4acd7091c7730ea/src/main/java/se/danielmartensson/pi4j/ADS1115_ADS1015.java#L136
To:
This should use the default I2C provided as detected by the Pi4J framework.