United Kingdom
Asked — Edited

Functions Using Multiple Ez-B V4'S

User-inserted image

I want to start a new tutorial, and for this I am hoping for your input as well to make this work. With the ability of connecting more than one EZ-B v4 to a robot project, I feel that it would be very helpful for new and established members (myself included) to find out exactly what can be done using more than one v4.

My idea is to document what can and cannot be done on a secondary board, with a simple to understand format with a short explanation. There is information of what is achievable using more than one board in the EZ-Script menu (some may be included in this thread), clicking the "Help" icon on controls, and in the tutorials in the learn section, and some of ARCs controls have the option to select a board. But having a one stop list of all what can be done all in one place may be easier to search through, some of which may not be covered or easily understood in the script menu and learn section.

Some posible subjects with posible script examples that could be covered are...

.) Speech .) SayEZB .) i2c .) GetVoltage and GetCPUTemp .) MP3 triggers .) Serial commands .) GetServo .) ADC ports (eg, ADC sensor readings) .) Digital ports (eg, Digital On/Off) .) Ping sensors (with or without motor controllers) .) Battery monitor scripts .) Using Cheat Sheet (Control Commands) .) Auto Position control .) Limitations and differences using "AP mode" and "Client mode" with multiple boards.

and I'm sure that there are more subjects I have missed.

I know that many of the experienced members here use multiple boards in their projects, so your input here would be would be valuable and most welcome. So to anyone who wants to participate in this dynamic tutorial, remember to keep it short, easy to understand, and give simple script examples where appropriate so that our newer members and current users who find scripting a bit challenging, can pick thing up quickly and easily.

Add as few or as many as you like, and if you see anything that you think may be incorrect, then please let us know with your correct answer and solution. And if you have something you would like to ask about using multiple boards, don't be afraid to ask however silly you may think the question is, and we'll see if someone can answer you. I hope you all find this a good and useful idea, and I hope you take part in an effort to helping our fellow community members.:)


ARC Pro

Upgrade to ARC Pro

Don't limit your robot's potential – subscribe to ARC Pro and transform it into a dynamic, intelligent machine.

United Kingdom
#1  

So to get the ball rolling, here are the first "cans" and "cannot's" with the example I would like to have used that would be "Board 0" and "Board 2".

Movement panels.

A Movement Panel can only be used with "Board 0".

Servos.

Controlling a servo can be done using any board, in this example, "Board 0" and "Board 2". An example of a simple servo script would be...

# A normal servo script connected 
# to "Board 0".

Servo (D0,90)
# This servo is connected to "Board 2"

Servo (2.D0,90)

The "2." in the above script is the number of the board the servo is connected to. The same can also be done with servo speeds.

V4 camera.

You can connect an EZ-B v4 camera to any board. You can also have two v4 cameras connected to both "Board 0" and "Board 2" and can be selected from the camera control. You can also have two camera controls in any one ARC project.

Now, it's over to you...;)

#2  

Excellent Topic!

(Revised this post) I don't have much to contribute at the moment. I believe you can select serial ports in a similar way. Something like this, as I recall. UARTWrite(boardindex, port, data).

Also from what I have read, you can only send sound to board 0.

IsConnected(BoardIndex) is another one. As is ReleaseAll(BoardIndex). There seem to be 5 predefined board specific commands as well, Connect0 - Connect4.

United Kingdom
#3  

Thanks for pointing out the servo error. It was a typo thanks to my phones spellcheck. Hopefully we will get some good contributions from the other guys. If fact, it was your other thread that gave me the idea for this.

United Kingdom
#4  

Releasing all servos.

There is a script command called ReleaseAll() which will release all servos connected to the chosen v4. For example...

ReleaseAll(0)

will release all servos connected to "Board 0". And the following script...

ReleaseAll(2)

will release all "Board 2" servos from their holding positions.

I2C (script example).

Information for devices that use the i2c ports on the v4, can be sent and received on multiple boards. The following script is for an LCD05 display screen that will display that will time...

i2cwrite(0,0xc6,0,1,4,12,19,30,230,31,255,"Time is " + $time)

The very first zero in the script is the board number, in this case, "Board 0". To use this script with an LCD display connected to "Board 2", it would be as follows...

i2cwrite(2,0xc6,0,1,4,12,19,30,230,31,255,"Time is " + $time)
United Kingdom
#5  

Soundboard EZB.

The "Soundboard v4" can be used with muitiple boards. In ARC, click the configuration menu tab (small gear icon) on a soundboard v4 control, then select the board you want to use from the "Board#" drop down menu.

User-inserted image

User-inserted image

United Kingdom
#7  

Post deleted as it's no longer relevant.

#8  

I think I was wrong about that. The selection is by Digital Port, not by Board. Sorry. I'll delete the post since it doesn't really fit.

United Kingdom
#9  

No worries. I'm just wondering though, can anything that uses a digital port be defined by a board number first?

United Kingdom
#10  

I am not aware of anything which the digital port can do which cannot span across multiple boards. Unless anything new and unique has been added recently everything which uses a digital port can be defined by using boardno.portno

i.e. PWM(1.D0, 100) Servo(3.D8, 60) Ping(2.D18, 0.D0) #0.D0 can be written as just D0 too

etc.

Movement panels and other controls may not always have the board option available. Generally script commands will where they refer to the ADC or Digital Ports.

United Kingdom
#11  

That's cool. Thanks Rich. I didn't actually now you could just use just the D0 input on board 0 when using multiple boards, and that's exactly the reason why I started this thread. Little gems like that people may not be aware of.

I'm also not aware of anything that won't work that way on another connected board except motor controllers where a Movement Panel is concerned.

Thanks for your input Rich. Much appreciated, and helpful.

United Kingdom
#12  

In the script menu, there is the following statement...

Quote:

SendSerial( digitalPort, baudRate, data, ... )

Does anybody know if a board number can assigned to this, like the following...?

SendSerial( Board number. DigitalPort, BaudRate, Data, ... )

Also, it would be great to see some input the from EZ-Robot guys, especially in regards to control commands, using Auto Position, getting v4 info, and the difference between AP and Client modes (if any) when using multiple boards. I know that there will be lots of members who would welcome any contribution.

United Kingdom
#13  

Another possibility that may be useful, can variables be set on a "per board" basis, and if so, what examples could this be used for?

United Kingdom
#14  

Thanks to the guys who have responded, but I think I'm going to close this thread due to the surprising lack of interest. I'm suppried there hasn't been more input from others willing to help, as I know many of you use more than one board in your projects. It's a shame, as I thought this would be a good way to document using multiple boards in one place, and find out things that may not necessarily mentionedor explained with examples in the learn section. As I mentioned, this needed input from others to make this work.

Thread closed.

#15  

Re-opening as this was a useful thread.

As of 5/23/16 build, SayEZB() and SayEZBWait() both accept an optional second parameter that specifies the EZB Index to output to as per this request: https://synthiam.com/Community/Questions/5889

Example




SayEZB("Hello, i am a second ezb", 1)


Copied from release notes verbatim

Alan