Sleep in between enc_tgt functions[SOLVED]

Hello

I’ve been trying to have my robot preform a series of enc_tgt things

for example:

enc_tgt(1, 1, 18)
forward()
enc_tgt(1, 0, 18)
right()

But the robot does weird random stuff
i tried making it sleep in between(sleep(0.1)
and do

while read enc_status():

       sleep(0.)
       print("next")

but that just makes it print next a bunch of times

Thanks to you all at Dexter industries!!

You are telling it to wait zero seconds and print next. So i’m guessing you want it to sleep half as much? To do that simple change sleep(0.)
To sleep(0.05)

Is that it?

Sorry that was a typo. I meant 0.1 thanks anyways @graykevinb !

Even still your code is written to print out “next” super fast. The only way to stop printing out a bunch of nests is to not print them out at all.

Never mind I made the same typo in the program! All well that ends well! Thanks!

Ahh ok. The typo wasn’t a typo. It was an accurate representation of the
program witht he typo! :wink:

This topic was automatically closed after 24 hours. New replies are no longer allowed.