myro

How to make a robot navigate a maze?

青春壹個敷衍的年華 提交于 2020-01-15 08:29:25
问题 I'm using the Myro library with the Python language. I've had some weird results. My idea was to call the getObstacle sensors. left = getObstacle(0) center = getObstacle(1) right = getObstacle(2) I want the robot to move forward as long as the center obstacle sensor is less than or equal to 4500. If the right obstacle sensor on the robot has a higher reading than the left obstacle sensor, I want it to turn left. Otherwise turn right. Here are my attempts on youtube Attempt 1 Attempt 2 I'm

How do you play two different song files on python at the same time?

我只是一个虾纸丫 提交于 2019-12-08 07:00:24
问题 I'm trying to play song1 and song2 (the commented out one) at the same time, but I don't know how to do that using myro or winsound or whatever it is. Someone suggested using threading, but I'm not sure how to do that either, since I am just a very baby beginner programmer. Would someone please help me figure this thing out and/or explain in detail how to do this? Here's what I have so far: import winsound from myro import * def main(): HftM1 = makeSong("Db4 3/8; C4 3/8; Bb3 1/4; Bb3 3/8; Ab3