Page 477 - Robot Builder's Bonanza
P. 477

Chapter 36







                           Programming Concepts:


                                           The Fundamentals



















                       ack in the “olden days,” you built a robot with a couple of motors, some tubes and a
                   Brelay, and a big ol’ battery. Today, many robots, including the amateur variety, are
                   equipped with a computational brain of one type or another, and the brain is told what to do
                   through software programming.
                     Why is this progress over tubes and a big ol’ battery? The brain and programming are
                   almost always easier and less expensive to implement than other methods. The nature of the
                   programming depends on what the robot does. All its actions boil down to a relatively small
                   set of instructions in whatever programming language you are using. If you’re new to pro-
                   gramming or haven’t practiced it in several years, read through this chapter to learn the basics
                   of programming for controlling your robots. It discusses rudimentary stuff so you can better
                   understand the more technical material in the chapters that follow.
                     Of course, if you’re already familiar with programming, feel free to skip this chapter.


                   Unless otherwise noted, the programming examples used in this chapter are what’s called
                     pseudo- code. It isn’t fully functioning code, and it’s highly unlikely it’ll work as is in whatever
           G       programming environment you’re using. So don’t try.  Pseudo- code uses  En glish- like phrases to
                   demonstrate the overall intent of the programming.
                     If you want to see actual runnable code, refer to the chapters in parts 7 and 8. Additional
                   programming examples are provided on the RBB Online Support site, detailed in Appendix A.


                   Important Programming Concepts


                   There are 11 important concepts in understanding programming, whether for robots or oth-
                   erwise. In this chapter, we’ll talk about each of the following in greater detail:


           446







   36-chapter-36.indd   446                                                                     4/21/11   11:57 AM
   472   473   474   475   476   477   478   479   480   481   482