#include <PortIn.h>
A multiple pin digital input
Example:
#include "mbed.h"
DigitalOut ind(LED4);
int main() {
while(1) {
int pins = p.read();
if(pins) {
ind = 1;
} else {
ind = 0;
}
}
}
mbed::PortIn::PortIn |
( |
PortName |
port, |
|
|
int |
mask = 0xFFFFFFFF |
|
) |
| |
|
inline |
Create an PortIn, connected to the specified port
- Parameters
-
port | Port to connect to (Port0-Port5) |
mask | A bitmask to identify which bits in the port should be included (0 - ignore) |
void mbed::PortIn::mode |
( |
PinMode |
mode | ) |
|
|
inline |
Set the input pin mode
- Parameters
-
mode | PullUp, PullDown, PullNone, OpenDrain |
mbed::PortIn::operator int |
( |
| ) |
|
|
inline |
int mbed::PortIn::read |
( |
| ) |
|
|
inline |
Read the value currently output on the port
- Returns
- An integer with each bit corresponding to associated port pin setting
The documentation for this class was generated from the following file: