Just posting this because the documentation was a little difficult to understand.
A MD10C has 3 spots (Direction, PWM, and ground) which means the "Robot" type of controls won't work.
("robot" controls each pin like it's forwards or backwards)
Example to get MD10C working (pins are just the ones I used for testing):
from gpiozero import PWMOutputDevice
motor_speed.PWMOutputDevice(16)
motor_direction.PWMOutputDevice(26, active_high=True, initial_value = 0) #active_high and initial value are optional
motor_direction.off() #on() reverses
motor_speed.value = 1 #changes the speed for both forward and reverse between 0 and 1 (%)
Wasn't much in the way of sample code in my searches so hopefully someone will find this useful.
A MD10C has 3 spots (Direction, PWM, and ground) which means the "Robot" type of controls won't work.
("robot" controls each pin like it's forwards or backwards)
Example to get MD10C working (pins are just the ones I used for testing):
from gpiozero import PWMOutputDevice
motor_speed.PWMOutputDevice(16)
motor_direction.PWMOutputDevice(26, active_high=True, initial_value = 0) #active_high and initial value are optional
motor_direction.off() #on() reverses
motor_speed.value = 1 #changes the speed for both forward and reverse between 0 and 1 (%)
Wasn't much in the way of sample code in my searches so hopefully someone will find this useful.
Statistics: Posted by James12345 — Wed May 29, 2024 5:50 pm — Replies 0 — Views 34