Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
DigitalIn Class Reference
The DigitalIn interface is used to read the value of a digital input pin. More...
#include <DigitalIn.h>
Inherits CPPToPigpio::CPPToPigpio.
Public Member Functions | |
| DigitalIn (PinName pin) | |
| Create a DigitalIn connected to the specified pin. | |
| DigitalIn (PinName pin, PinMode mode) | |
| Create a DigitalIn connected to the specified pin. | |
| DigitalIn (int pin) | |
| Create a DigitalIn connected to the specified pin. | |
| DigitalIn (int pin, PinMode mode) | |
| Create a DigitalIn connected to the specified pin. | |
| int | read () |
| Read the input, represented as 0 or 1 (int) | |
| operator int () | |
| An operator shorthand for read() | |
| void | mode (PinMode mode) |
| Set the input pin mode. | |
| bool | operator== (int) |
| Check equality of pin to other DigitalIn pin. | |
| bool | operator== (DigitalIn &) |
| Check equality of pin to other DigitalIn pin. | |
| ~DigitalIn () | |
| Deconstructor. | |
Detailed Description
The DigitalIn interface is used to read the value of a digital input pin.
Definition at line 6 of file DigitalIn.h.
Constructor & Destructor Documentation
| DigitalIn | ( | PinName | pin ) |
Create a DigitalIn connected to the specified pin.
- Parameters:
-
pin DigitalIn pin to connect to
Definition at line 3 of file DigitalIn.cc.
| DigitalIn | ( | PinName | pin, |
| PinMode | mode | ||
| ) |
Create a DigitalIn connected to the specified pin.
- Parameters:
-
pin DigitalIn pin to connect to mode the initial mode of the pin
Definition at line 10 of file DigitalIn.cc.
| DigitalIn | ( | int | pin ) |
Create a DigitalIn connected to the specified pin.
- Parameters:
-
pin DigitalIn pin to connect to
Definition at line 17 of file DigitalIn.cc.
| DigitalIn | ( | int | pin, |
| PinMode | mode | ||
| ) |
Create a DigitalIn connected to the specified pin.
- Parameters:
-
pin DigitalIn pin to connect to mode the initial mode of the pin
Definition at line 22 of file DigitalIn.cc.
| ~DigitalIn | ( | ) |
Deconstructor.
Definition at line 61 of file DigitalIn.cc.
Member Function Documentation
| void mode | ( | PinMode | mode ) |
Set the input pin mode.
- Parameters:
-
pull PullUp, PullDown, PullNone, OpenDrain
Definition at line 37 of file DigitalIn.cc.
| operator int | ( | ) |
An operator shorthand for read()
- See also:
- DigitalIn::read()
Definition at line 32 of file DigitalIn.cc.
| bool operator== | ( | DigitalIn & | other ) |
Check equality of pin to other DigitalIn pin.
Definition at line 56 of file DigitalIn.cc.
| bool operator== | ( | int | in ) |
Check equality of pin to other DigitalIn pin.
Definition at line 51 of file DigitalIn.cc.
| int read | ( | ) |
Read the input, represented as 0 or 1 (int)
- Returns:
- An integer representing the state of the input pin, 0 for logical 0, 1 for logical 1
Definition at line 27 of file DigitalIn.cc.
Generated on Tue Jul 12 2022 14:39:23 by
1.7.2