Here is a photo of the completed rover bot:
Now comes the hard part, the programing.
The first program I wrote is for diagnostic purposes. I wanted the program to do three things to help me get things organized.
First, to identify and name each input and output. It’s critical to give names to I/O that are both Easy to recognize and not use any programing key words. I try to make the names short, but intuitive. I also put a lot of comments into my programs. These comments do not take up any memory space in the robot brain, they reside only in the editing software on my Mac.
Second, to test each output to make sure it electrically and mechanically worked. No mater how much I try, it is easy to get a wire misplaced and have a red LED light up when you want a green one on. Motors are also easy to get mis-wired, when the computer says to turn clockwise, it turns counter clockwise. This really sucks.
Third, I need to make sure that each input works and gives the processor something useful to read. I need to test each switch, range finder, and button to make sure that the reading is useful. If the range finder is constantly reading the ground in front of it rather than an obstacle it is useless. Garbage in garbage out.
In my next post will show an example of the programing code. The Arduino programing code is a lot like C, but with some additions and changes. This doesn’t bother me in the slightest because I never learned C. I do have enough programing experience with industrial controls and some old knowledge of archaic programing languages to help.
To me this is the fun part. I love learning stuff like this, on my own terms, without formal instruction. It’s great if you have the time and your job doesn’t depend on it!