RTduino Source Code Reference Manual
Macros | Functions
I/O

Digital input and output pins. More...

Macros

#define INPUT   0x0
 Configures the pin as an input. /.
 
#define OUTPUT   0x1
 Configures the pin as an output. /.
 
#define INPUT_PULLUP   0x2
 Configures the pin as an input with an internal pull-up resistor. /.
 
#define INPUT_FLOATING   INPUT
 Configures the pin as a floating input (same as INPUT). More...
 
#define INPUT_PULLDOWN   0x3
 Configures the pin as an input with an internal pull-down resistor. More...
 
#define OUTPUT_OPEN_DRAIN   0x4
 Configures the pin as an open-drain output. More...
 

Functions

void pinMode (uint8_t pin, uint8_t mode)
 Configures the specified pin to behave either as an input or an output. More...
 
void digitalWrite (uint8_t pin, uint8_t val)
 Writes a HIGH or a LOW value to a digital pin. More...
 
int digitalRead (uint8_t pin)
 Reads the value from a specified digital pin, either HIGH or LOW. More...
 

Detailed Description

Digital input and output pins.

Macro Definition Documentation

◆ INPUT_FLOATING

#define INPUT_FLOATING   INPUT

Configures the pin as a floating input (same as INPUT).

Note
RTduino extension. /

◆ INPUT_PULLDOWN

#define INPUT_PULLDOWN   0x3

Configures the pin as an input with an internal pull-down resistor.

Note
RTduino extension. /

◆ OUTPUT_OPEN_DRAIN

#define OUTPUT_OPEN_DRAIN   0x4

Configures the pin as an open-drain output.

Note
RTduino extension. /

Function Documentation

◆ digitalRead()

int digitalRead ( uint8_t  pin)

Reads the value from a specified digital pin, either HIGH or LOW.

/

Parameters
pinThe number of the pin to read from.
Returns
The value read from the pin (HIGH or LOW).
See also
https://www.arduino.cc/reference/en/language/functions/digital-io/digitalread

◆ digitalWrite()

void digitalWrite ( uint8_t  pin,
uint8_t  val 
)

Writes a HIGH or a LOW value to a digital pin.

/

Parameters
pinThe number of the pin to write to.
valThe value to write (HIGH or LOW).
See also
https://www.arduino.cc/reference/en/language/functions/digital-io/digitalwrite

◆ pinMode()

void pinMode ( uint8_t  pin,
uint8_t  mode 
)

Configures the specified pin to behave either as an input or an output.

/

Parameters
pinThe number of the pin to be configured.
modeThe mode to set for the pin (INPUT, OUTPUT, INPUT_PULLUP, INPUT_PULLDOWN, OUTPUT_OPEN_DRAIN).
Note
This function can only be used for digitalRead() and digitalWrite().
For analogRead() or analogWrite(), please DO NOT use this function to configure the pin.
See also
https://www.arduino.cc/reference/en/language/functions/digital-io/pinmode