Digital Input
Overview
Digital inputs are binary signals that can be read by digital pins on a microcontroller. These signals can exist in one of two states: HIGH or LOW. The state is determined by the voltage present on the pin. A HIGH state typically corresponds to a voltage close to the supply voltage (e.g., 5V or 3.3V), while a LOW state corresponds to a voltage close to 0V.
Example: Button as a Digital Input
A common example of using digital input is with a button. In this setup, a digital pin on the microcontroller is configured to detect the HIGH or LOW state based on whether the button is pressed or not. When the button is pressed, the circuit is completed, and the pin reads a HIGH state. Conversely, when the button is not pressed, the pin reads a LOW state. This simple mechanism allows the microcontroller to respond to user inputs through button presses, enabling a wide range of interactive applications.
FAQ (Frequently asked questions)
What are digital inputs?
What states can digital inputs be in?
How is the state of a digital input determined?
How can a button be used as a digital input?