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.
DigitalOut Class Reference
The DigitalOut interface is used to configure and control a digital output pin. More...
#include <DigitalOut.h>
Inherits CPPToPigpio::CPPToPigpio.
Public Member Functions | |
DigitalOut (PinName pin) | |
Create a DigitalOut connected to the specified pin. | |
DigitalOut (PinName pin, int value) | |
Create a DigitalOut connected to the specified pin. | |
DigitalOut (int pin) | |
Create a DigitalOut connected to the specified pin. | |
DigitalOut (int pin, int value) | |
Create a DigitalOut connected to the specified pin. | |
void | write (int value) |
Set the output, specified as 0 or 1 (int) | |
int | read () |
Return the output setting, represented as 0 or 1 (int) | |
operator int () | |
A shorthand for read() | |
DigitalOut & | operator= (int) |
A shorthand for write() | |
DigitalOut & | operator= (DigitalOut &rhs) |
A shorthand for write() | |
~DigitalOut () | |
Deconstructor. |
Detailed Description
The DigitalOut interface is used to configure and control a digital output pin.
Definition at line 7 of file DigitalOut.h.
Constructor & Destructor Documentation
DigitalOut | ( | PinName | pin ) |
Create a DigitalOut connected to the specified pin.
- Parameters:
-
pin DigitalOut pin to connect to
Definition at line 2 of file DigitalOut.cc.
DigitalOut | ( | PinName | pin, |
int | value | ||
) |
Create a DigitalOut connected to the specified pin.
- Parameters:
-
pin DigitalOut pin to connect to value the initial pin value
Definition at line 7 of file DigitalOut.cc.
DigitalOut | ( | int | pin ) |
Create a DigitalOut connected to the specified pin.
- Parameters:
-
pin DigitalOut pin to connect to
Definition at line 14 of file DigitalOut.cc.
DigitalOut | ( | int | pin, |
int | value | ||
) |
Create a DigitalOut connected to the specified pin.
- Parameters:
-
pin DigitalOut pin to connect to value the initial pin value
Definition at line 19 of file DigitalOut.cc.
~DigitalOut | ( | ) |
Deconstructor.
Definition at line 54 of file DigitalOut.cc.
Member Function Documentation
operator int | ( | ) |
DigitalOut & operator= | ( | DigitalOut & | rhs ) |
DigitalOut & operator= | ( | int | value ) |
int read | ( | ) |
Return the output setting, represented as 0 or 1 (int)
- Returns:
- an integer representing the output setting of the pin, 0 for logical 0, 1 for logical 1
Definition at line 32 of file DigitalOut.cc.
void write | ( | int | value ) |
Set the output, specified as 0 or 1 (int)
- Parameters:
-
value An integer specifying the pin output value, 0 for logical 0, 1 (or any other non-zero value) for logical 1
Definition at line 24 of file DigitalOut.cc.
Generated on Tue Jul 12 2022 14:39:23 by
