HIGH LOW

From Microduino Wiki
Jump to: navigation, search

HIGH|LOW

Pin voltage definition, HIGH and LOW

When read or write to the digital pins, the values of the digital pins have only two possible values: HIGH and LOW 。.

  • HIGH

The implication of HIGH(the reference pin) depends on the setting of pin, and the meanings are different when the pin is defined as INPUT and OUTPUT. When a pin is set as INPUT through pinMod and reading through digitalRead, if the current voltage of the pin is larger or equal to 3V, the microcontroller will return HIGH. The pin can also be set as INPUT through pinMode, and as HIGH through digitalWrite. And the value input into the pin will be controlled on HIGH by a internal 20K pull-up resistor, unless an external resistor pull it to LOW. When a pin is set as OUTPUT through pinMode, and digitalWrite as HIGH, the voltage of the pin maybe 5V. In this state, it can output current. For example, light a LED which is of a pin connected to the ground or of which the OUTPUT property is set as LOW.

  • LOW

The meaning of LOW also depends on the setting of the pin, and the meanings are different when the pin is defined as INPUT and OUTPUT. When a pin was set as INPUT through pinMode and as read through digitalRead, if the current voltage of the pin is less or equal to 2V, the microcontroller will return LOW. When a pin is set as OUTPUT through pinMode, and as LOW through digitalWrite, this pin is 0V. In this state, it can flow backward current. For example, light a LED which is connected to +5V through a serial resistor or to a pin set as OUTPUT and HIGH.

[Return to Arduino Syntax Manual]