A digital input, used for reading the state of a pin. More...
#include <DigitalIn.h>
Public Member Functions | |
DigitalIn (PinName pin) | |
Create a DigitalIn connected to the specified pin. More... | |
DigitalIn (PinName pin, PinMode mode) | |
Create a DigitalIn connected to the specified pin. More... | |
int | read () |
Read the input, represented as 0 or 1 (int) More... | |
void | mode (PinMode pull) |
Set the input pin mode. More... | |
int | is_connected () |
Return the output setting, represented as 0 or 1 (int) More... | |
operator int () | |
An operator shorthand for read() More... | |
A digital input, used for reading the state of a pin.
Example:
Definition at line 54 of file DigitalIn.h.
DigitalIn | ( | PinName | pin | ) |
Create a DigitalIn connected to the specified pin.
pin | DigitalIn pin to connect to |
Definition at line 61 of file DigitalIn.h.
DigitalIn | ( | PinName | pin, |
PinMode | mode | ||
) |
Create a DigitalIn connected to the specified pin.
pin | DigitalIn pin to connect to |
mode | the initial mode of the pin |
Definition at line 72 of file DigitalIn.h.
int is_connected | ( | ) |
Return the output setting, represented as 0 or 1 (int)
Definition at line 102 of file DigitalIn.h.
void mode | ( | PinMode | pull | ) |
Set the input pin mode.
pull | PullUp, PullDown, PullNone, OpenDrain |
operator int | ( | ) |
An operator shorthand for read()
Definition at line 116 of file DigitalIn.h.
int read | ( | ) |
Read the input, represented as 0 or 1 (int)
Definition at line 84 of file DigitalIn.h.