0

When creating a new motor object from the GPIOzero module like this: import gpiozero, then motor1 = gpiozero.Motor() you need to specify the backward and forward pins. What does that mean and what if the motor only has two pins?

2

You need to specify the GPIO you are connecting to the motor driver board which in turn controls the motor.

The motor driver board normally has two pins per motor. If you set one pin high, the other low, the motor turns clockwise, if you reverse the polarity the motor goes counter clockwise.

For the gpiozero documentation see https://gpiozero.readthedocs.io/en/v1.2.0/api_output.html#motor

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.