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 unsigned char Crc::CrcLib::GetDigitalInput(unsigned char pin)
The following parameters must be passed to the function for it to work properly:
pin
: The name of the digital pin you want to read the state of. Must be of the typeunsigned char
.
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
?
The Arduino environment, when speaking of voltage, uses the constant HIGH
to represent its presence and LOW
to represent its absence. In electronics, a voltage presence (or when is is greater than a certain value) is usually represented by true
, while an absence of voltage (or when it is lower than a certain value) is usually represented by false
.
Articles liés
-
CrcDuino: détails matériels (Système CrcDuino System) —
Cette page présente les différents composants physiques qui se retrouvent sur une carte électronique CrcDuino. C’est une lecture assez chargée, mais elle en vaut la peine!
Toutes les valeurs de voltage indiquées sont par rapport à la broche
GND
. Celles-ci sont toutes connectées entre elles, alors elles peuvent toutes être utilisées à votre guise. -
CrcLib: accéder aux broches IO (Système CrcDuino System) —
Cette page présente les constantes symboliques définies dans CrcLib en utilisant la directive du pré-processeur
#define
.Broches
-
Déverminage - Codes d'erreur CrcLib (Système CrcDuino System) —
Cette page présente les codes associés au mode d’erreur de CrcLib.
Qu’est-ce que c’est ?
-
GetDigitalInput() {FR} (Système CrcDuino System) —
Objectif
Obtenir l'état d’une entrée numérique (DIO) sur le CRCduino.
Quand l’utiliser
-
SetDigitalOutput() {FR} (Système CrcDuino System) —
Objectif
Contrôle une broche numérique(DIG) en mode sortie
Quand l’utiliser
-
SetDigitalPinMode() {FR} (Système CrcDuino System) —
Objectif
Permets d’utiliser les entrées sorties numériques (DIO) en indiquant à la librairie si cette broche doit être une entrée ou une sortie.
Quand l’utiliser?
Add Comment