Active project?
Robert Savage
robert at savage7.com
Thu Nov 12 15:21:40 UTC 2015
Hi Jeff,
I'll test PWM out later today on a RPI2b just to verify that its still
working. Maybe some bug or update was introduced that now causes it to
fail but it was certainly working at one point in the past. I will verify
PWM output with an oscilloscope. (Pi4J used WiringPi under the covers
which writes directly to the Broadcom SoC memory to control GPIO, so it
should not be limited to the Linux device/sysfs interface.)
Thanks, Robert
On Thu, Nov 12, 2015 at 10:13 AM, Jeff Prestes <jeffprestes at gmail.com>
wrote:
> Hi All,
>
> Thanks for the answers.
>
> Robert, first, congratulations for your project. It helped me a lot. But
> regarding PWN, I am sorry but I've tried to run your code above in my
> RaspberryPis (B+ and 2) couple of months ago for my project Brasilino (
> https://github.com/jeffprestes/brasilino) and I couldn't control a servo
> motor like I do with Arduino. I believe it's not your code's fault but as
> Sergey said a lack of Linux functionality.
>
> Gerrit, I will try to see what possible workaround Michael has created for
> this. Thanks for sharing it.
>
> Best,
>
> -Jeff
>
> On Thu, Nov 12, 2015 at 6:47 AM, Robert Savage <robert at savage7.com> wrote:
>
>> Hi Jeff,
>>
>> You should be able to use PWM with Pi4J.
>>
>> Simple hardware PWM example:
>>
>> package gpio.test;
>>
>>
>> import com.pi4j.io.gpio.GpioController;
>> import com.pi4j.io.gpio.GpioFactory;
>> import com.pi4j.io.gpio.GpioPinPwmOutput;
>> import com.pi4j.io.gpio.RaspiPin;
>>
>>
>> public class PwmTest {
>>
>> /**
>> * @param args the command line arguments
>> * @throws java.lang.InterruptedException
>> */
>> public static void main(String[] args) throws InterruptedException {
>>
>> GpioController gpio = GpioFactory.getInstance();
>> GpioPinPwmOutput pwm = gpio.provisionPwmOutputPin(RaspiPin.
>> GPIO_24);
>> pwm.setPwm(500);
>>
>> // keep program running until user aborts (CTRL-C)
>> for (;;) { Thread.sleep(500); }
>> }
>>
>> }
>>
>>
>> Thanks, Robert
>>
>> On Wed, Nov 11, 2015 at 11:55 PM, Jeff Prestes <jeffprestes at gmail.com>
>> wrote:
>>
>>> Hey Andrew,
>>>
>>> I've tried but using dio or Pi4J I couldn't simulate a PWM.
>>>
>>> Best,
>>>
>>> -Jeff
>>>
>>> On Wed, Nov 11, 2015 at 5:21 PM, Andrew Penhorwood <andrew at coldbits.com>
>>> wrote:
>>>
>>> > Is this project active? I was hoping for some pointers on how to do
>>> PWM
>>> > with the raspberry PI.
>>> >
>>> > --
>>> > Andrew Penhorwood
>>> >
>>> >
>>>
>>
>>
>
More information about the dio-dev
mailing list