Port mode()

The mode() function member sets the I/O data direction of the DIO pin associated with a specific port.

The mode2() function member sets the I/O data direction of the AIO pin associated with a specific port.

The mode3() function member sets the I/O data direction of the IRQ pin associated with a specific port. Note that this is the same pin on all ports.

#include <Ports.h> 
#include <RF12.h> // needed to avoid a linker error :(

Port port (1);
void port.mode(byte direction);
void port.mode2(byte direction);
void port.mode3(byte direction);

Parameters

direction

Either INPUT or OUTPUT. These constants are pre-defined as 0 and 1, respectively.

Notes

This is a thin wrapper around the Arduino pinMode() function.