Support for stepper motors added to Pi4J API

546 views
Skip to first unread message

Robert Savage

unread,
Dec 31, 2012, 5:10:47 PM12/31/12
to

Diego Medina

unread,
Jan 11, 2013, 12:59:37 AM1/11/13
to pi...@googlegroups.com
Hi,

I'm using 0.0.5-SNAPSHOT from sonatype, but I get a compiler error saying

[error] .../src/main/scala/com/fmpwizard/gpio/Controller.scala:4: object component is not a member of package com.pi4j
[error] import com.pi4j.component.motor.impl.GpioStepperMotorComponent
[error]                 ^


which jar is the one that has components?

P.S. I'm using this library from scala, and the other GPIO examples work fine, like the one to turn an LED on and off.

Thanks

  Diego

Robert Savage

unread,
Jan 11, 2013, 1:10:12 AM1/11/13
to
Hi Diego,

The "components" are currently located in the pi4j-device.jar.  
I think they will ultimately move into the core library, but they are just now getting API defined :-)   

Thanks, Robert

Diego Medina

unread,
Jan 11, 2013, 7:00:57 AM1/11/13
to Robert Savage, pi...@googlegroups.com
awesome, thanks!
> --
>
>



--
Diego Medina
Lift/Scala Developer
di...@fmpwizard.com
http://www.fmpwizard.com

Ryan White

unread,
Dec 11, 2014, 11:37:00 PM12/11/14
to pi...@googlegroups.com
Hi Robert

Pi4J is excellent, and I'm planning on using it in a little x-y positioning system. I'm using a system outlined here: http://corexy.com/theory.html - which looks like it needs the two stepper motors to run at the same time. Not being a Java programmer, I can't figure out how to run two stepper motors at the same time. Is there sample code somewhere, or could you provide me with a snippet or link to documentation or something that would help me out?

Any and all info much appreciated!
Thanks
Ryan

Robert Savage

unread,
Dec 12, 2014, 8:46:52 AM12/12/14
to Ryan White, pi...@googlegroups.com
Hi Ryan,

Let me start off with saying that I'm certainly no expert when it comes to stepper motor control :-) 
I have not implemented anything complicated or precision based personally. 

For the conversation, I'll assume your stepper motors are controlled via PWM (Pulse Width Modulation).
(There are other type of motor control out there)

Unfortunately the Raspberry Pi only includes a single PWM pin.  
This means that for a high precision solution, you will need some external peripheral device to provide additional PWM support.
This board is one example: https://www.adafruit.com/product/815
This board includes the PCA9685 chip which provides 16 channels of PWM.

One of the community members (Christian Wehrli) contributed an Pi4J extension to support the PCA9685 chipset.

And here a a couple of code examples using this extension:

I hope this helps get you started :-)
Thanks, Robert




--
You received this message because you are subscribed to the Google Groups "Pi4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pi4j+uns...@googlegroups.com.
Visit this group at http://groups.google.com/group/pi4j.
To view this discussion on the web visit https://groups.google.com/d/msgid/pi4j/6c576375-3ad4-4c57-ba25-34f7e045c288%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages