Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6970

Beginners • Loop problem in python 3.9

$
0
0
I am using Python 3.9, Speech Recognition, espeakng, obstacle avoidance. Everything works but I obviously have a loop to that keeps checking distance. If under 15 inches it stops, reverses, turn left and Loops back. While it is checking distances I have espeakng say "stop" when to close to obstacle, "backward" "left" etc. But when the distance is over 15 inches it moves forward and I want espeakng to say "forward". But since it is looping to check distance it keeps saying "forward". How do I get it to say forward only once when it moves forward instead of repeating it everytime it checks distance?

Statistics: Posted by Rok1330 — Sun Jan 26, 2025 4:51 pm — Replies 2 — Views 34



Viewing all articles
Browse latest Browse all 6970

Trending Articles