Running Script Stuck In A Loop

 
#1

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 EZ Builder doesn't stop the loop. What could be causing this?

Cheers.

#2

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.

#3

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...

Code:


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)

#4

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.

#5

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.

#6

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.

#7

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.

#8

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*

#9

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

#10

I haven't tried it on a new project yet, but here's the thing. I have a script using another sound file and another RGB action and they play nice together...

Code:


ControlCommand("RGB Animator 2", AutoPositionAction, "KITT 1")
sleep(13000)
ControlCommand("RGB Animator 2", AutoPositionStop)
sleep(800)
ControlCommand("RGB Animator", AutoPositionAction, "round eye blink")



The following script works absolutely fine...

Code:


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)
sleep(400)
servo(d18,155)
servospeed(d18,1)
sleep(2000)
servo(d18,38)
servospeed(d18,1)
sleep(2000)
ControlCommand("Soundboard v4", Track_37)
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)
sleep(1000)
ControlCommand("Soundboard v4", Track_38)



but the moment I put the following ControlCommand() at the end of the script (or anywhere within the script too) and run it, the audio plays normally for a couple of seconds the start to play a random small section of the audio over and over.

Code:


ControlCommand("RGB Animator", AutoPositionAction, "round eye blink")



The red LED on the EZ-B4 comes on and stays on with a solid light, and becomes unresponsive. I close EZ-Builder and the repeating sound byte continues to play. I disconnect and reconnect the power and all is well until I run this one script again. I remove the CC script and the rest of it works. I have never come up against this before and the whole script (above) actually did work yesterday. Just part of my bad day today my original project which had this working somehow managed to lose 80% of the controls (I think that was my fault) so I have had to redo the whole project again from scratch (and saved to the cloud). its annoying that this happens and even more so when the EZ-B freezes. It's weird how my other project script with these 2 controls work. *confused*