Welcome, Guest. Please login or register.
June 20, 2013, 03:05:24 AM
<< Back to The NXT Step Home Page    Home Help Search Login Register

+  The NXT STEP Forum
|-+  General Category
| |-+  General Discussion
| | |-+  Working with two nxt intelligent bricks together
« previous next »
Pages: [1] Print
Author Topic: Working with two nxt intelligent bricks together  (Read 4193 times)
bcowie
Newbie
*
Posts: 4


View Profile
« on: September 26, 2009, 08:41:19 PM »

I am thinking about adding a second control brick. My primary purpose is to increase the # of controllable motors from 3 to 6. I am also considering mindsensors multiplexer. I use the PSP2 for remote control so I am not interested in using the new brick for that purpose.

My Question......Can I control both bricks from a single (NXT-G) program, presumably using one brick to run the program as master with the other slaved via Bluetooth.I am wondering if the second brick (slave) can respond to standard blocks.

To Illustrate a "for instance", here is a hypothetical.

Using 2 bricks with 6 motors....all motor ports full[. Can I send a motor block command to the motor on brick 2/Port B.How would I identify which "Port B" I mean. Are there custom blocks to handle this sort of thing or is there something more basic that I am missing?

Any advice is welcome, and I would be particularly interested if anyone has experience working with multiple control bricks

Thanks
Report to moderator   Logged
Dino_Martino
Hero Member
*****
Posts: 411


AC-130: my other passion, the sky!


View Profile WWW
« Reply #1 on: September 27, 2009, 01:00:25 AM »

The only way to communicate rough BT is by using the BT communication blocks (send BT message, wait for BT mesage, etc.).
so the only way to do this, is this:
1. you'll need to program the master NXT to send BT messages to the slave NXT.
2. you'll need to program the slave NXT to respond to these messages.

eg.
master sends a BT:
- a number message to indicate the port: "1" (this would meen "A"),
- a boolean message to command the dirrection: "true" = forward
- a number message to command pwer level: "100"
- a number message to command duration:   "360"

you would ofcourse need to use different mailboxes for each command.

This is one of the million possebilities, but it's a good technique.
I added an exemple slave and master code fragment.
I needed to zip them because they where to large.


bottom line:
The only messages you can send via BT are: bolean, number and text.
You'll need to figure out a way to code and decode all your commands into these.
you have 10 different mailboxes, use them wisely.
a hint: you could use a message in a mailbox to indicate wich function you are going to command, so you're not limitied to these 10 different mailboxes.

* slave.zip (120.57 KB - downloaded 429 times.)
* master.zip (21.89 KB - downloaded 355 times.)
Report to moderator   Logged

bcowie
Newbie
*
Posts: 4


View Profile
« Reply #2 on: September 27, 2009, 01:42:29 AM »

That is great info....thanks a lot.
Report to moderator   Logged
Paulette
Newbie
*
Posts: 9


View Profile
« Reply #3 on: October 01, 2009, 06:20:37 AM »

Here's a link to a youtube video of two robots each with two bricks using blutooth communication. http://www.youtube.com/watch?v=2IjkocRiASA
The two builders and programmers are 13 year old students.
They created dance robots for the Robocup Junior competition in Australia.
They use bluetooth messages to start the programs running on each brick with the push of one touch sensor.  This ensures all 4 bricks are running in time with the music.
They also use messages within the 4 programs to ensure the robots are synced.
They spent many months and learnt a lot preparing for the competion.
One of the discoveries they made was that with the master sending messages to three slaves, there needs to be at least 1 second between each message being sent to a different brick. This is so that there is time for the Master to change channels. This frustrated them for a good amount of time before they figured it out.
It all looks so simple when you watch the results.
Enjoy...
Report to moderator   Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!