BLE temperature profile using digital DS1820 or analog LM35 sensors

Dependencies:   DS1820

Embed: (wiki syntax)

« Back to documentation index

DigitalInOut Class Reference

DigitalInOut Class Reference

A digital input/output, used for setting or reading a bi-directional pin. More...

#include <DigitalInOut.h>

Public Member Functions

 DigitalInOut (PinName pin)
 Create a DigitalInOut 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)
void output ()
 Set as an output.
void input ()
 Set as an input.
void mode (PinMode pull)
 Set the input pin mode.
DigitalInOutoperator= (int value)
 A shorthand for write()
 operator int ()
 A shorthand for read()

Detailed Description

A digital input/output, used for setting or reading a bi-directional pin.

Definition at line 27 of file DigitalInOut.h.


Constructor & Destructor Documentation

DigitalInOut ( PinName  pin )

Create a DigitalInOut connected to the specified pin.

Parameters:
pinDigitalInOut pin to connect to

Definition at line 34 of file DigitalInOut.h.


Member Function Documentation

void input (  )

Set as an input.

Definition at line 65 of file DigitalInOut.h.

void mode ( PinMode  pull )

Set the input pin mode.

Parameters:
modePullUp, PullDown, PullNone, OpenDrain

Definition at line 73 of file DigitalInOut.h.

operator int (  )

A shorthand for read()

Definition at line 92 of file DigitalInOut.h.

DigitalInOut& operator= ( int  value )

A shorthand for write()

Definition at line 80 of file DigitalInOut.h.

void output (  )

Set as an output.

Definition at line 59 of file DigitalInOut.h.

int read (  )

Return the output setting, represented as 0 or 1 (int)

Returns:
an integer representing the output setting of the pin if it is an output, or read the input if set as an input

Definition at line 53 of file DigitalInOut.h.

void write ( int  value )

Set the output, specified as 0 or 1 (int)

Parameters:
valueAn integer specifying the pin output value, 0 for logical 0, 1 (or any other non-zero value) for logical 1

Definition at line 43 of file DigitalInOut.h.