Looking for a cool gift for the holidays? Maybe something for the children that also you can enjoy. How about the CAR-100 Bluetooth car from Sony Ericsson? Download the attached Bluetooth jar file to your P900 and check out just how much fun it is.
Switch on the Bluetooth car, start the Bluetooth Car demo on the P900 and control the car as follows:
Place the stylus on the top of the steering wheel (at the 12:00 o'clock position). Control the speed of the car by sliding the pointer up and down and turn the car by sliding the pointer right and left. You will see the graphics change as you move the pointer. You can change the speed and direction simultaneously so be careful to move the pointer in straight lines if you are interested in only changing the speed or direction of the car.
Note that you must keep the pointer continually pressed to control the car, and releasing the pointer will return the gear-shift to the neutral position and the steering-wheel to the forward position, thus stopping the car. The program contains a recorder that allows you to record the movements of the car and then replay them.
Below is a brief description of the software.
The Bluetooth CAR-100 is controlled by a string of AT commands. For example, to make the car go forward you need to send the command string "+CKEV: u,1" and the string "+CKEV: d,1" will make it go backward. So the job of the software is to convert the GUI commands from the user to the correct AT commands.
The Bluetooth Car demo application was written in J2ME MIDP 2.0 with the JSR-82 Bluetooth API and contains the following classes:
- BluetoothCar - The main program that contains the standard MIDP startApp(), pauseApp(), and destroyApp() methods. The startApp() method creates the Car API, GUI, and SPPServer objects.
- Car API - This class allows the CarConnection and GUI to communicate with each other. It provides getter and setter methods that allow the GUI class to control the Bluetooth car and check its status.
- CarConnection - This starts a communication connection with the car, retrieves user commands and sends them to the car, and maintains the status of the car. The processEvents() method reads the stream of user commands and converts it into a stream of control commands required by the Bluetooth car (e.g. the string "+CKEV: u,1" means "go forward").
- GUI - The Graphic User Interface (GUI) provides the user with graphics and sound. The screen consists of a steering wheel for turning the car and a gear shift for changing the speed and direction. The steering wheel allows the user to turn the car hard-left, left, straight, right, and hard-right and the gear-shift changes the speed between first, second, third gear, neutral and reverse.
- SPPServer - This class contains the JSR-82 APIs and creates an RFCOMM SPP (Serial Port Profile) server connection, waits for the client to connect and then creates a connection to the car. This is done in the defineService() method using the Connector.open ("btspp:// localhost:1101;name= xSPPServer") command which specifies a btspp (Bluetooth Serial Port Profile) scheme, localhost as the host, the service UUID, and a friendly name.
If you hurry before the holidays, then you can modify the code to enhance the features of the car before you give it as a gift. Maybe you want to have more than one record/playback memory track or pre-programmed patterns that enable the car to avoid obstacles around the house, or a graphical build-your-own virtual race track, or maybe have two cars racing. The possibilities are many.

|