Toddler
Toddler is a new addition to my robots. Toddler is a bipedal robot made of 2 servos. Its brain is a basic stamp 2 microcontroller. Here are a few pics of the robot. Here is some basic stamp code by which the robot can be controlled by a java programme. One can write plain pbasic programmes to make the robot walk and do things. Or one may write  java applications to control it via serial port using serin and debug commands in pbasic. On the Java end you would need java communication api. Just use the serial cable which comes with basic stamp to hook up with the computer.
Toddler Walking on my desk
Interfacing Basic Stamp (Toddler) and Java using Java Communication API.
Java Code
Basic Stamp Code
On the PC side you need an application to communicate via serial port. The basic stamp editor has a built in debugger, in which one can type the commands. But one would like to be able to control the software throug an application. I used java comm api to control the robot. Install it and the easiest way to get started is use the SerialDemo example which comes with the java comm api. Simply run the example, select COM1 and connect to port. Run the basic stamp, and you will be able to communicate to the basic stamp.


--------------------------
SerialDemo example code(zipped source files). You will need to install the java comm api.

Screen Shot of Serial Demo in work with toddler. When the user enters 1 the toddler starts walking. 
`simple example of hooking to a PC applicaion
`via the serial port, the PC and stamp together
`can make powerful applications
`{$STAMP BS2}
`{$PBASIC 2.5}
RPin CON 16
BMode CON 86
MaxTime CON 3000
Freq VAR WORD

Main:
DEBUG "Enter Walk Command", CR
SERIN RPin, BMode, MaxTime, Timeout, [DEC freq]
DEBUG "The Command was", DEC freq , CR
IF freq = 1 THEN Walk   'if user typed 1
GOTO Main

Timeout:
DEBUG "Timeout!", CR
PAUSE 500
GOTO Main

Walk:
DEBUG "Put the walking code here"
RETURN
--------------------------
Modified toddler First Steps Source
Hosted by www.Geocities.ws

1