RTduino Source Code Reference Manual
|
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... | |
Digital input and output pins.
#define INPUT_FLOATING INPUT |
Configures the pin as a floating input (same as INPUT).
#define INPUT_PULLDOWN 0x3 |
Configures the pin as an input with an internal pull-down resistor.
#define OUTPUT_OPEN_DRAIN 0x4 |
Configures the pin as an open-drain output.
int digitalRead | ( | uint8_t | pin | ) |
Reads the value from a specified digital pin, either HIGH or LOW.
/
pin | The number of the pin to read from. |
void digitalWrite | ( | uint8_t | pin, |
uint8_t | val | ||
) |
Writes a HIGH or a LOW value to a digital pin.
/
pin | The number of the pin to write to. |
val | The value to write (HIGH or LOW). |
void pinMode | ( | uint8_t | pin, |
uint8_t | mode | ||
) |
Configures the specified pin to behave either as an input or an output.
/
pin | The number of the pin to be configured. |
mode | The mode to set for the pin (INPUT, OUTPUT, INPUT_PULLUP, INPUT_PULLDOWN, OUTPUT_OPEN_DRAIN). |