
R1D1

First off, let me say thank you to all of you who have been so helpful. I'm a newbe with EZ-Builder, so I really appreciate the assistance.
I'm having trouble with a script getting hung up, or stopping because of an error. It's a fairly striaght forward script, just moving a pan servo with my HCsr04 sonar on it, looking for obstacles, and directing the drive motors. Someone was very helpful in pointing out the Variable watch as this was a great help in debugging. I also used the Console to watch the code execute, and finally got it working the way I expected it too.
Then I downloaded the same code to my tablet and the code hangs up apparently early in its execution. First off, I don't understand why it would work on my PC and not on the tablet, I know the tablet does not have all of the functionality as the PC, but I'm only using the following commands;
If/then
servo()
servospeed()
goto()
print()
sleep()
getping()
return()
Is there a way to watch it execute on the tablet the way you can use the Console on the PC so I can debug this?
Thanks
Code:
:DirectionDecision
Servo(D0,108)
Servo(D1,108)
Servo(D0,98)
Servo(D1,118)
sleep(2000)
Servo(D0,108)
Servo(D1,108)
This may not be your main problem but it will get this section working.
Still don't understand though why this would work from the PC and just not on the tablet? I would like to be able to debug from the tablet in the future. Above you said to use the Script Control, but I don't see this on the tablet anywhere. I looked under the controls tab and the closest thing I could find is the "Script Manager", but that says it's not available on the mobile.
I need to debug it from the mobile because my script works when run from my PC and when I open the script to edit it and click on the run script, but does not work when run from my mobile app.
Thanks in advance for any direction.
You can use temporary flags to help debugging, it's what I did when scripting anything. This is as simple as using something like $DebugFlag0 = 1
Pop those in various places, rename them if needed i.e. $SonarFault = 1 and watch the variable watcher. If it doesn't error on the PC then it wont error on the tablet. If it does have strange behaviour on the tablet then the problem lies in the OS or software on the tablet and I would suggest removing and reinstalling everything again on the tablet.
Another thing you could do is add an LED which will blink at specific points in the script. While running from the tablet count the blinks, you can then find out exactly where the script is when it fails.
To add, on the PC, if you are debugging a script in the script control it runs slower. This is important to note when you are relying on time i.e. the sleep commands or the time it takes to compute so many commands.
There is a definite difference between running my script from my pc & tablet, as I have done it several times. I hadn't thought about the tablet is being the issue, as I have run about half a dozen other scripts without issue. I even got a notice last week that there is an update for my android is, and am putting off installing it because I was afraid of software conflicts with ARC.
Thanks again, will give it a shot.