A Quick Introduction to BBRC
or How I learned to stop worrying and love BBRC
What does it do?
BBRC or the Battlebricks Remote Control is a Windows program that sends coded messages to the RCX in order to get it to perform predetermined actions.
How does it work?
The RCX has a handy facility (at least when using NQC) that allows it to receive one byte at a time through the IR link.
In order to control more than one robot at a time, we multiplex the messages through BBRC and assign certain message ranges to certain robots. This might not sound very powerful, but let me assure you, it works just fine. One byte allows for 255 unique messages to be sent to the RCX. If we have a moderately large amount of bots to control, let's say 8, that leaves us with 32 messages that can be sent to each bot individually. That's 32 control signals for each bot. Not too shabby.
How do I get it to work?
Using BBRC is quite simple if you understand what it is doing under the hood. BBRC responds to button presses on USB gamepad devices (or the keyboard). It then uses an internal map file to figure out what message to send when a given button is pressed. This is where you come in. You have two jobs to do in order to get BBRC running.
- You must download a properly written program to the RCX.
This program is very simple. It basically converts an IR message into an action. It takes the form of a simple case statement. The basic idea is this:
- Wait for IR message
- Is the message for me
- No? Goto 1
- Yep, which one is it
- Do something
- Do something else
You can find an example NQC program on the main BBRC page.
- You must map the buttons on the gamepads to messages that BBRC should send to the robots
This too is pretty simple. First off, start up BBRC. If you have a USB gamepad, it should show up in the left hand list. In order to see if things are working properly, click on the "Messages" check box oer the right hand box and hit some buttons. The right window should show a flurry of button messages flying by. You can use this to figure out what the system thinks the buttons on your gamepad are named.
Once you find the gamepad you want to configure, double-click on it. This brings up the message configuration dialog. The controls list out all of the configurable buttons for the gamepad including the direction pad. There are two events BBRC understands, make and break. A make event is sensed when you press a button on the pad. A break event is sensed when you let up on the button you just pressed. If you press the button, you get both a make and a break message.
BBRC allows you to configure a specific message to be sent for each event. Just click on the Make or Break region next to the control you want to associate it with and type in the number of the message you want to send. Click off of the control to see the change. Hit "OK" to accept the changes.
Now, when you hit the gamepad button, the desired message should be shown in the Log (right window). Remember, these messages should correspond to messages you've associated with actions in your RCX program. So, let's say I configure the Up Make message to send messaeg 26. I need to make sure there is a case in my RCX program to handle message 26. So, now, the robot knows that when it sees message 26 over the IR, it should perform the code within the 26 case in it's programming.
Now, you're almost there. You have your RCX programmed. You have all of your buttons mapped in BBRC. You can make sure that the Tower is sending by checking that any mapped button on the gamepad causes the little green light in the tower to turn on. (Note: Message 0 is special. If a button is mapped to 0, it will NOT send a message to the tower. This is in effect a NULL message and can not be used) The final thing you need to do to get the system to work is to hit RUN on the RCX. Even though the bot is programmed, it won't respond to these particular IR messages until you RUN the program.
That should be it. There's not much more to it than that. Happy Remote Controlling!