-1
I’m developing a programming for EV3, with python, and what I wanted to know is: How can I create a loop per seconds, IE, I want that in a certain time in seconds, the robot does the actions uninterruptedly, so I can not use Sleep or some other delay
def SeguirLinha(lado, tempo, cor):
if lado == 'D':
while tempo:
if sensor() == cor:
MotorDireita.run( Velocidade )
MotorEsquerda.run( Velocidade )
else:
MotorDireita.run( Velocidade )
MotorEsquerda.run( Velocidade * -1 )
What I want to change is there in "while time:" and make the while run only during the time the user decides