Read several IOs of a port at the same time.

Dependencies:   mbed

main.cpp

Committer:
bcostm
Date:
2014-02-21
Revision:
0:f7c4107b448c
Child:
1:a33d077656dc

File content as of revision 0:f7c4107b448c:

#include "mbed.h"
 
PortIn myIOs(PortC, 0xE000); // PC_15 + PC_14 + PC_13
 
DigitalOut myled(LED1);
 
int main() {
  while(1) {
    if (myIOs.read() != 0xE000) { // Any of the 3 IOs is low
      myled = !myled; // Toggle LED state
      wait(0.2);
    }
  }
}