Mastering Arduino
上QQ阅读APP看书,第一时间看更新

Input

The input block will contain electronic components that give the control circuit information. These components give the control circuit the ability to sense the outside world. Some examples of input components would be:

  • Buttons or switches: Buttons and switches can be used to turn the flow of electricity on or off. When they are in the off-state electricity will not flow through the circuit; however, when they are in the on-state electricity does flow through the circuit.
  • Temperature sensors: Temperature sensors adjust the amount of resistance in a circuit based on the temperature causing the voltage to vary by the temperature. By reading the amount of voltage coming in, the control circuit can calculate the current temperature.
  • Range finders: There are many types of range sensors; however, the basic idea is the voltage that is outputted by the sensor varies depending on how close an object is to it. Like the temperature sensor, the control circuit can then calculate the distance based on the voltage coming in.
  • Proximity sensor: This is a sensor that is triggered when something gets within a certain distance of the sensor. A proximity sensor is usually either ON (full voltage) or OFF (no voltage).