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 52 of file DigitalIn.h.
DigitalIn | ( | PinName | pin | ) |
Create a DigitalIn connected to the specified pin.
pin | DigitalIn pin to connect to |
Definition at line 59 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 70 of file DigitalIn.h.
int is_connected | ( | ) |
Return the output setting, represented as 0 or 1 (int)
Definition at line 104 of file DigitalIn.h.
void mode | ( | PinMode | pull | ) |
Set the input pin mode.
pull | PullUp, PullDown, PullNone, OpenDrain |
Definition at line 91 of file DigitalIn.h.
operator int | ( | ) |
An operator shorthand for read()
Definition at line 118 of file DigitalIn.h.
int read | ( | ) |
Read the input, represented as 0 or 1 (int)
Definition at line 81 of file DigitalIn.h.