This 'robby' ? https://projects.raspberrypi.org/en/pro ... ld-a-buggy
Things to check:
- Loose contacts
- wrong object instantiation
- defect boards
- wrong connection to RPi
- defect GPIO pin on RPi
Aside from loose contacts I would check whether the instantiation of the robby-objects is correct:
print( robby.left_motor.forward_device)
print( robby.left_motor.backward_device)
print( robby.right_motor.forward_device)
print( robby.right_motor.backward_device)
Example output
>>> print (rob.left_motor.forward_device)
<gpiozero.PWMOutputDevice object on pin GPIO7, active_high=True, is_active=False>
Check the pin numbers.
When setting forward then the output changes to
>>> rob.forward()
>>> print (rob.left_motor.forward_device)
<gpiozero.PWMOutputDevice object on pin GPIO7, active_high=True, is_active=True>
Defect Boards ?
For a test, (connect board GND to RPI GND, provide Motor voltage with the batteries) you can remove the GPIO connection from the motor board and connect (IN1; IN2) to (GND; VCC3.3V) and then (VCC3.3V; GND) which should activate the motor forward, backward. Also check IN3, IN4.
Eventually exchange the motor boards, perhaps the error moves with the boards?
Things to check:
- Loose contacts
- wrong object instantiation
- defect boards
- wrong connection to RPi
- defect GPIO pin on RPi
Aside from loose contacts I would check whether the instantiation of the robby-objects is correct:
print( robby.left_motor.forward_device)
print( robby.left_motor.backward_device)
print( robby.right_motor.forward_device)
print( robby.right_motor.backward_device)
Example output
>>> print (rob.left_motor.forward_device)
<gpiozero.PWMOutputDevice object on pin GPIO7, active_high=True, is_active=False>
Check the pin numbers.
When setting forward then the output changes to
>>> rob.forward()
>>> print (rob.left_motor.forward_device)
<gpiozero.PWMOutputDevice object on pin GPIO7, active_high=True, is_active=True>
Defect Boards ?
For a test, (connect board GND to RPI GND, provide Motor voltage with the batteries) you can remove the GPIO connection from the motor board and connect (IN1; IN2) to (GND; VCC3.3V) and then (VCC3.3V; GND) which should activate the motor forward, backward. Also check IN3, IN4.
Eventually exchange the motor boards, perhaps the error moves with the boards?
Statistics: Posted by ghp — Mon Dec 02, 2024 7:08 am