A control program usually requires more than turning outputs on and off. They switch on and off because an event has happened. This event is then connected to the input of the microcontroller to ‘tell’ it what to do next. The input could de derived from a switch or it could come from a sensor measuring temperature, light levels, soil moisture, air quality, fluid pressure, engine speed etc.
Analogue inputs are dealt with later, in this chapter we will concern ourselves with digital on/off inputs.
New instructions used in this chapter:
As an example let us design a circuit so that switch, SW1 will turn an LED on and off.
The circuit diagram is shown in Figure 5.1.
Figure 5.1 ...