In some cases, the controller is just telling the world what to do, and does not care what may be going on in the world. But most of the time, the controller wants to check on a condition - peeking at the condition of the outside world - before doing something. In computer jargon, it is said that the computer has inputs.
This page is an overview of some background that is necessary to discuss input and output.
We have examples of input and output using BASIC Stamp.
Let's say that you have a friend Tom (who is 6' tall), and Mary (who is 5'6" tall). You can say "Tom is taller than Mary." Tom is described in terms relative to Mary. Even if you don't know exactly how tall Tom is (but Mary is nearby), you can envision Tom as being taller.
You can't use a relative description without something to base it on. You can say "My friend Tom is tall", without reference to anybody else. But you can't say "My friend Tom is taller", unless you state or imply some standard against which to measure. Otherwise, one is inclined to ask, "Taller than whom?"
In the same way, signals going into or out of a controller must be described relative to something. That thing is the "ground" of the controller.
So...
Positive Logic - Save Your Sanity
Computers and
controller
are powerful and flexible.
Modern digital computers deal in the binary system of ones and zeroes,
so even the math isn't hard.
But humans can easily be confused if they use inconsistent terminology to communicate with computers.
As an example, the horn on an automobile is usually activated with a momentary switch. Left to itself, the switch does nothing and the horn does nothing. But when you press the switch, the horn honks. That's positive logic - you have to do something (press button) to get an effect (horn honks).
But consider an automobile with a different kind of switch - one that makes noise when left to itself and stops when you press the button. That's negative logic - you have to not do something (don't press button) to get an effect (horn honks).
Negative logic can be useful, but is also confusing. Would you like driving a car that required you to keep pressing the horn button just to drive in silence?
We suggest that you use positive logic wherever possible and adhere to the following conventions:
| all in this column are equivalent | all in this column are equivalent |
|---|---|
| true | false |
| yes | no |
| 1 | 0 |
| on | off |
| high | low |
| +5 Volts | ground (0 Volts) |
| active | inactive |
| do something | do nothing |