I want to control a motor and a servo motor using a Raspberry Pi. As I searched, all projects are for pi4j v1.0. I'll be grateful if you guide me. Thanks in advance.
-
There must be hundreds of tutorials not using pi4j. You need to try searching again.– joanCommented Jun 18, 2022 at 15:38
-
I did a very quick google search. "pi4j tutorial" gives many results. Likewise, "pi4j motor control" returns several results.– NomadMakerCommented Jun 18, 2022 at 16:33
-
There are tutorials for controlling a motor with Pi4j 1.0, but I could not find any tutorial for controlling a motor using Pi4j 2.0 ! @NomadMaker– MehdiCommented Jun 19, 2022 at 3:04
-
is V2.0 that much different from V1.0? ... what kind of a motor are you trying to control? ... how is the motor connected to the RPi?– jsotolaCommented Jun 20, 2022 at 5:58
-
@jsotola I have nothing to do with their difference. I just want to use pi4j v2 to control a servo motor and a normal dc motor.– Reza GholipourCommented Jun 20, 2022 at 12:40
Add a comment
|
1 Answer
Within the CrowPi example project, several examples are available for different types of motors, all using V2 of Pi4J.
More info about the project on:
Code is available on:
- https://github.com/Pi4J/pi4j-example-crowpi/blob/main/src/main/java/com/pi4j/crowpi/components/ServoMotorComponent.java
- https://github.com/Pi4J/pi4j-example-crowpi/blob/main/src/main/java/com/pi4j/crowpi/components/StepMotorComponent.java
- https://github.com/Pi4J/pi4j-example-crowpi/blob/main/src/main/java/com/pi4j/crowpi/components/VibrationMotorComponent.java