Page 56 - The Definitive Guide to Building Java Robots
P. 56

Preston_5564C02.fm  Page 37  Wednesday, September 14, 2005  5:42 AM



                                                                     CHAPTER 2  ■  SERIAL COMMUNICATION   37


                        Section Summary

                        You should now be able to connect to the serial port on your robot from any place in the world.
                        You can write your programs at your PC and as long as you have network connectivity to the
                        serial port on your robot, all the programs can be run from your PC.
                            The classes and JSP I introduced in this section were

                           • WebSerialPort: The class that accesses the serial port on the web server for the JSP.
                           • Webcom.jsp: The Java Server Page that provides access from the WebSerialPort to the
                             WebSerialClient, or direct access via the browser.
                           • WebSerialClient: The class that implements the JSerialPort interface which allows access
                             to a serial port on a web server the same way you can access a serial port on your local
                             machine.
                            Depending on your configuration, you’re ready to start accessing your microcontroller via
                        your serial port.


                        2.4  Serial Communications with a Microcontroller

                        Once you have thoroughly tested and used some of the classes accessing your PC’s serial port,
                        you’re ready to send and receive some data with it. To do this, connect the serial cable from
                        your PC to your Parallax Board of Education. You can see in Figure 2-5 that the BOE has a spot
                        for either the BASIC or Javelin Stamp, connectors for a serial cable, battery, and bread board for
                        use in experimentation.




























                        Figure 2-5. The Parallax Board of Education
   51   52   53   54   55   56   57   58   59   60   61