Asked — Edited
Resolved by Redzone!
Upon manually connecting to Board 0, I would like to establish a connection to Board 1 using EZ-Script, process some initialization there (ie: 1.D0 do thus and such) Can I and if yes, how do I connect to Board 1 from script?
Upgrade to ARC Pro
Get access to the latest features and updates with ARC Early Access edition. You'll have everything that's needed to unleash your robot's potential!
0.d1 = EZB board 0 digital port 1
1.D2 = ARC board 1 digital port 2
And so on
Yeah - My question is not how to address the port on the board (once it is running). That's simple.
Can I CONNECT to Board 1 with CODE?
This is listed on the tab " cheat Sheet" when you open a script
Hope this is what you are asking
Interesting... Board 1 connected, executed it's Init Script, and when finished, the Init Script for Board 0 did NOT continue executing.
Bad Dog. Is there a way to get the rest of the InitScript for Board 0 to complete?
#Board 0 Script:
SayEZB("Initializing Board Zero")
ControlCommand( "Connection", "Connect1" )
#do the rest of my init routines for Board 0 here (is not happening...)
second, use the SayEZBWait() command if you want to wait for it to speak.
The EZ-Script manual is along the right when editing scripts. Here's a screenshot
When you see something BLUE in someones reply, you can click on it. For example the Cheat Sheet is in blue. Click on it so you can read about it. Also, ControlCommand is in blue, click on it so you can read about it.
(ps Thank you for your help with this!)
@mayaway, us the SayEZBWait() command Like DJ said.
At a quick look you script looks ok, nice init script too.
"First, use the [ code ] formatters if you wish to display code"
I am not quite sure what this means or how to do it, though I think there must be a way to indicate that a block of my post is code - so I'll see if I can figure out how to do that...
"second, use the SayEZBWait() command if you want to wait for it to speak."
This sounds good because it may solve my problem, and you are also simply 'giving me a fish' and I want to learn HOW to fish... So I'll go lookup this command and maybe it will explain WHY I should use it...
If you scroll to the bottom of your reply you'll see a list of many of these commands use for new when replying.
SayEZBWait("some text") is explicitly for completing the text to speech before moving on. Good tip but not the solution for my problem, which is:
1. I manually start Board 0 by clicking [Connect] in the Connection Control
2. My Init Script begins to execute:
3. At which point the Init Script for Board 1 executes perfectly, but FAILS to Return control to the calling Init Script for Board 0
Would the command
at the end of the Init Script for Board 1 solve this?
You might want to post your full init script so we can see exactly what you're trying to do thanks.
There are probably multiple ways to do this, and I may be missing a simpler way, but one way you can do this is in your board 0 init script, initialize a variable. example
then, after the ControlCommand() that starts board 1, you use waitforchange command to look for the value of $script0 to change
this will pause the script until the value of the variable changes.
Now, in your second script, after it has done all of its activity, the last command in the init script for board 1 would change the value of the variable, which triggers the waitforchange to take action and continue the script for board 0.
At the beginning of Init Script for Board 0 I have
and at the end of the Init Script for Board 1 I have
whereupon the Board 0 Init Script executes and skips the initialization of board 1 which has already been done.
Glad you got it working.
Also make sure to place Sleep() commands where needed to give devices time to move into place or finish their function. The script will fly by time sensitive commands without letting them complete. If something is not working look at this as a possible issue.
One more tip; If you try to send an improper command through any of the UART ports the EZB will disconnect. You'll also lock up an EZB if you try to send a command through these UART ports before you initialize the one you want to use. If used, Uarts should also be initialized in your "only" INT script. You only need to do this once per EZB boot up.
I'm no shining example of an EZ script code writer but below is my INT script that will explain what I'm talking about:
One last tip. In the future try not to be so quick to mark a help thread resolved until your sure your problem is actually fixed. You run the rick of not getting the help you really need. There are lots of people here willing to lend a hand.
After reading through the OP's posts in this thread it sure sounds like he was trying to use separate scripts to start up and set up each EZB. Then run start up routines for devices attached to it's EZB that it's starting.
EDIT: Actually if your sending a Sendserial command through a digital port then your are correct. You dont need to use a UARTinit() command. Only use the UARTinit() command if you're sending through a UART port.
Servo Speed commands are hard to understand (for me at least). Here's a few notes from the Script help section in ARC:
That's correct... before you set servo speed you need to set an initial servo position so....