I'm trying to control a robot via a Raspberry Pi, using Python language. If I run the commands from the shell they work fine. If I call them from a *.py script the robot doesn't move. If in the script I put the command print('hello') the word 'hello' is displayed but the motors still do not move. How can I solve the problem? Thank you
from gpiozero import Motor
motor1 = Motor(4, 14)
motor2 = Motor(17, 27)
motor1.forward()
motor2.forward()
UPDATE: I solved the problem with sleep(5) after the command for move motors. Thanks!!!