Page 82 - Hacking Roomba
P. 82

Chapter 3 — Building a Roomba Serial Interface Tether                 63



                             If the forward button is clicked, the following command is issued:
                             roombacomm.goForward();

                             This sends Roomba forward at the current speed setting.
                             Feel free to delve into the internals of the RoombaComm library. If you are familiar with Java
                             JAR files, there is a roombacomm.jar that contains the full library so you can write your own
                             programs. How to do this is discussed in Chapter 7.


                     Summary


                             Congratulations! You have hacked your Roomba! You have created a Roomba serial interface
                             tether, the foundation for all future Roomba robotics hacking. Now you can begin experiment-
                             ing with Roomba as a computer-controlled robot, using either the RoombaCommTest pro-
                             gram or writing your own code. Even just driving the robot around from your computer is a lot
                             of fun.
                             If this was one of your first circuits to build, congratulations are in order again. You now can
                             build your own electronic circuits and know the fundamentals of three of the most important
                             concepts in circuit design: power supplies, visual indicators, and signal-level translators.
                             Virtually all circuits (certainly all the ones in consumer devices) employ at least two of those
                             sub-circuits. When examining other circuits, you can look for these sub-circuits to learn how
                             the whole works. The Roomba, for example, has a few variations of all three sub-circuits, and
                             you could take apart other devices to find examples of them there too.
                             At a system level, with serial terminal programs and loopback cables, you can debug almost any
                             kind of RS-232 or similar serial connections. Serial communication is the basis for most gadget
                             communication. You’ll run into it in many of the other projects. Serial is also the basis for more
                             advanced computer communication like USB, Firewire, Ethernet, or Wi-Fi. The basic con-
                             cepts (receive and transmit signals, communication speed, loopback, and others) you’re now
                             familiar with, and the diagnostic techniques used are translatable to these more advanced serial
                             protocols.
                             Start thinking about designing your own circuits to work with other gadgets around your
                             house. Maybe add a status light for something you wished you knew was on, or build a battery-
                             replacement power supply, or even build PC interfaces for other devices you may have. Almost
                             every gadget with an embedded microcontroller like Roomba has a serial port, although it may
                             not be as accessible as the Roomba port.
   77   78   79   80   81   82   83   84   85   86   87