United Kingdom
Asked — Edited

Running Script Stuck In A Loop

Hi. I'm looking for a little help. I have a script I just wrote, but when it executes It doesn't fully run and the audio file the script has gets stuck in a loop and I have do disconnect the EZ-B's power to get it to stop. Closing ARC doesn't stop the loop. What could be causing this?

Cheers.


ARC Pro

Upgrade to ARC Pro

Join the ARC Pro community and gain access to a wealth of resources and support, ensuring your robot's success.

United Kingdom
#1  

Without seeing the script it's difficult to say, there is a lot that could be causing it. You are, in effect, phoning a garage and "my car doesn't work, what's wrong with it?" and expecting that to be enough information for an answer.

Post the script and we can see where it's going wrong.

United Kingdom
#2  

Oops, sorry about that. I thought I posted the script. Had an internet connection problem and it obviously didn't like the script I copied over mad. Here it is...


ControlCommand("Soundboard v4", Track_35)
sleep(5500)
servo(d20,60)
servospeed(d20,2)
sleep(1200)
servo(d20,0)
servospeed(d20,2)
sleep(2000)
ControlCommand("Soundboard v4", Track_36)
servo(d13,90)
servo(d18,155)
servospeed(d18,1)
sleep(2000)
servo(d18,38)
servospeed(d18,1)
sleep(2000)
ControlCommand("Soundboard v4", Track_37)
ControlCommand("RGB Animator", AutoPositionAction, "Scan test")
servo(d16,1)
servospeed(d16,1)
servo(d17,180)
servospeed(d17,1)
sleep(1000)
servo(d16,180)
servospeed(d16,1)
servo(d17,1)
servospeed(d17,1)
sleep(1500)
servo(d16,90)
servospeed(d16,1)
servo(d17,90)
servospeed(d17,1)
ControlCommand("Soundboard v4", Stop)

sleep(3000)
ControlCommand("RGB Animator", AutoPositionAction, "round eye blink")
ControlCommand("Soundboard v4", Track_38)

United Kingdom
#3  

Do any of the Auto Position actions, RGB Animator or sounds have any scripts assigned to them too?

There is no code there which would loop, there are a lot of redundant or unnecessary lines of code though which may not help, mainly the servospeed() lines, some are duplicated, some are changed after the servo moves and no other servo movements on that port afterwards...

You may be better off adding the movements for the servos as frames and actions, it's a much simpler method than scripting servo movements. Since trying the Auto Position control and adding frames and actions I have removed a large portion of the scripts which I have in my projects. New projects I don't even contemplate scripting movement of servos any more.

United Kingdom
#4  

No, the sound files and animator are stand alone and have no scrips assigned to them. I will try out the Auto Position control as I've not tried this yet. I thought the servospeed lines I had were necessary as when a servo turns one way at a set speed, they return a faster speed without another servospeed line.

The script was working fine until I got towards the end when the audio started repeating itself then the battery needed charging. I will have another play a little later.

United Kingdom
#5  

Figured out what the problem is. Running a sound file and the animator at the same time freezes the EZ-B. I added a short RGB animation script to a sound file, executed the new script, then the red LED on the EZ-B comes on, and stays on and then unable to use it unless I do a power cycle. Has anyone else expearianced this bug? Funny thing, it worked a couple of days ago.

United Kingdom
#6  

Running the animator and sound file at the same time does not cause the EZ-B to freeze. The video of JD dancing which DJ posted at the weekend shows the animator working and sound files. Also, I did not experience any issues when creating and testing the dance routine I'm working on.

Is the RGB animator connected properly? Is the address in the control OK? If an I2C command is sent and the I2C device is not connected, doesn't understand the command etc. then it will cause the EZ-B to hang, this is how the manufacturers of the EZ-B's processor designed the processor.

United Kingdom
#7  

Well it caused mine to freeze, every time I tried it today. Everything is connected ok, battery is fully charged, and the address is ok. They both work fine seperatly, just not together. And as I mentioned it worked yesterday no problems. The only change was I started a new project and deleted the old one. But both scripts were the same. I think the EZ-B has reset itself as it has kicked me out if client mode now. Not having a good day. mad mad

United Kingdom
#8  

Does it do it on a new project with only the animator and the soundboard added?