Robots are part of our everyday life, from when we wake up in the morning to when we go to bed at night. We do not know it, but they control our lives in many ways, for example our mobile phones, our computers, our cars etc. Robots also help us a lot in many ways that we do not think about because it happens so fast, and without them it would be very difficult to live. For all we know, robots might even take control of our world.
People and robots have a lot of differences as everybody knows, and it is known that robots are smarter than humans in many ways. They multitask 100 times more than we can, and do things that it would take years for us to do. They are able to think things through in the mechanical memory in seconds and it would take us hours for us to figure it out.
Robots consist of four major parts, which are Declarations and Variables, Subroutines and Functions, Initialization, and The Main Loop. The first part in most programs is used to include files that you need, to declare variables that you are going to use, and to define constants for use in your program. You should also put a comment at the top of the file that indicates what the program does.
You will find that lots of robot programs look alike, so having comments is an important way to tell them apart. In SBASIC, comments are done using the tick mark. Everything from the start of the ' mark to the end of the line is a comment, and will be ignored by the compiler.
Writing a single long line of code can be tedious, and can also increase your chances of coding in a bug. It is often best to create subroutines for handling blocks of code. If you code things up properly, you can also reuse code quite easily. The bulk of your software is going to exist in subroutines and functions. Most subroutines are very short, and consist of a well modularized bit of code.
The Main routine is called when the controller resets or is powered up. Its job is to initialize variables,...