I am working on a project that requires a group of Scribbler 2s to dance at the start of playing a wav file and stop at the end of the file.
(This is not the full code, but rather me testing how to do it so I can apply it to the larger code.)
from Myro import *
from winsound import*
from time import *
def playSong():
s=PlaySound('C:\Python34\cantHoldUs.wav',SND_FILENAME)
sleep(30)
s.PlaySound(None,SND_FILENAME)
while playSong()==True:
motors(-1,1)
The song plays and ends, but the robot does not move. Can anyone tell me how?
I'd recommend restructuring your code to something with a While Loop since it's cleaner and easier to control: