Over the last year or so, I have had a lot of fun played around with my TV Brat . Most of the stuff that I have done has been described in several different threads. Recently I was asked if I would be willing to share my stuff so others could take advantage of it, which I thought it was a great idea. So it took me a little while to get everything working reasonably well again and Beth created a project page for it, where you can download the code from.
http://img512.imageshack.us/img512/3475/brat2lv8.jpg
Please remember this is a work (play) in progress. All of the work in here was done for my own enjoyment so there are probably many rough edges!
Here is an updated description of changes I have made to the original TV Brat project:
What has changed:
The code started from the original TV brat code. The code is currently configured for the ABB board. It would not be difficult to convert to convert this code to use the newer Bot Board 2. If you are using the newer board you may want to update the pins the servos are plugged into to maybe match the code in the Autonomous Brat project.
Minor enhancements
I updated the IRPD code to no longer need a timer interrupts. It basically resets TimerA on each interrupt and we have enough resolution in the 8 bits of the counter. The code also detects when there is a timer overflow.
The movement functions (SSC-32 emulation) code that relies on Hservo was also modified to support a seventh servo, which I use for a head servo on which I have mounted one or more sensors such as a SRF08 range finder or which I am in the process of mounting a sharp GP2D120 sensor, such that I can play with the autonomous Brat code.
The code also has some basic serial LCD support for the Seetron as well as the Scott Edwards BP216, which has been sold on the Lynxmotion website… I use this for displaying debug and status information. For example if you hit the display key on the TV remote it enters into a special mode (until you hit display again). This code displays the remote code for each key you hit on the remote. I used this to debug and to find out which keys were hit on a more advanced remote.
Setting the servo Zero points
There is code in here that tries to set the zero point for the 7 servos (3 per leg plus head). You enter this mode by hitting the menu button on the TV remote. You then a number button for which servo you wish to adjust (1=Left Hip, 4=Left Knee, 7=Left Ankle, 3=Right Hip, 6=Right Knee, 9=Right Ankle, 2=Head), you can then hit volume± key to adjust the value by ± 75 or the Channel± keys to adjust by ±5. Pressing the Enter/return keys accepts the new value. The values are stored in the EEPROM on the Atom Pro.
Mini Sequencer using VB
The biggest change was the communications with a VB application, which works like a mini (rough) sequencer. This code is currently written for VB 2008 which can be downloaded from Microsoft. There are some rough edges here. For example the first communication with the BRAT will reboot the brat. I am not sure if there is any easy way around this as the Atom Pro IDE does the same when you connect one of its terminal windows. I have added some code to do a quick talk to the brat when the VB app starts and when the communication Port changes in the VB application.
Here is a screen shot of the VB application:
http://img100.imageshack.us/img100/869/miniseqsa3.jpg
In this VB application, you can set the values for the 7 servos by sliders/edit it in the text box, or set all of them at once in an edit box that is in the same format/order as the movement calls in the TV brat code. You can insert items/delete/move up/down items in a list.
Clicking the Try Item button will try the currently selected item in the sequence. If you click the Try Sequence button, the whole sequence will be downloaded to the brat and then it will run that sequence. Once you are happy with the sequence you can press the Save Sequence button, which will tell the Brat to save it in the Atom Pros EEProm. Pressing the “Get From Bratâ€