Sets up modes for assigned pins.
There are 16 pins on LinkIt ONE used as digital I/O, they are D0 ~ D13 and D18/D19, particularly D18/D19 are shared with Wire/I2C.
LinkIt One supports 3 pin modes:
- INPUT mode is used for reading voltage (HIGH or LOW) or sensor. In INPUT mode when the circuit is at high impedance, similar to serially connecting a big resistance in the circuit, the pin can read accurate voltage value. However, this pin may not have enough voltage to activate peripheral devices, e.g. LED.
- INPUT_PULLUP mode is similar to INPUT mode, used for reading voltage of sensor. However in this mode, the pin is often at high voltage when the sensor is disabled and turns to low voltage when the sensor is enabled, which is opposite to its behavior in INPUT mode.
- OUTPUT mode is used for controlling peripheral devices. In OUTPUT mode when the circuit is at low impedance, the pin has enough voltage to activate or control other devices but cannot read the voltage of sensor.