Nathan Yonkee / Mbed OS Nucleo_read_ios
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 #define IOS (0xA0) // PA_5 + PA_7
00004  
00005 PortIn myIOs(PortA, IOS);
00006  
00007 DigitalOut myled(LED1);
00008  
00009 int main() {
00010     while(1) {
00011         if (myIOs.read() != IOS) { // Any of the 2 IOs is low
00012             myled = !myled; // Toggle LED state
00013             wait(0.2);
00014         }
00015     }
00016 }
00017