Purpose
Get the value of a Digital Input (DI) of the board.
When to use
Whenever you need to use the state of a DI.
Where to use
Most probably in the void loop()
part of your .ino
file, since we’d usually want to actively monitor the value.
Click here to learn more on the DIOs of the 9880 board.
This function requires the use of the following CrcLib functions at some point of your .ino
file in order to work properly:
Returns
This function returns state of the DI mentioned as the function’s argument as an unsigned char
type. The value returned will be either one of these two possible values:
HIGH
, if voltage is applied to theSIG
pin of the digital port.LOW
, if no voltage is applied to theSIG
pin of the digital port.
Main prototype and parameters
static void Crc::CrcLib::SetDigitalPinMode(unsigned char pin, unsigned char mode)
The following parameters must be passed to the function for it to work properly:
pin
: The name of the digital pin you want to set. Must be of the typeunsigned char
.mode
: The mode you want to set the pin to. Must be of the typeunsigned char
. Needs to be one of the following:INPUT
, if you are using the digital pin as as input.OUTPUT
, if you are using the digital pin as as output.
Overloads
This function does not have any overloads. It can only be used as described by the main prototype.
Examples
More on this function
Why does this function return HIGH
/ LOW
, instead of TRUE
/ FALSE
?
Add Comment