External Interrupt example for WIZwiki-W7500 Academy

Dependencies:   mbed

Fork of GPIOIn_INT_HelloWorld_WIZwiki-W7500 by Lawrence Lee

main.cpp

Committer:
joon874
Date:
2015-07-02
Revision:
0:4052805e9292
Child:
1:95b6d8c7bb10

File content as of revision 0:4052805e9292:

/* Digital External Interrupt Example Program */

#include "mbed.h"
 
InterruptIn mysw(D10);
DigitalOut myled1(LED1);
DigitalOut myled2(LED2);
 
void exin(){
    myled2 = !myled2;
}
 
int main() {
    
    mysw.rise(&exin);    // attach the address of the flip function to the rising edge
    while(1) {           // wait around, interrupts will interrupt this!
        myled1 = !myled1;
        wait(1.0);
    }
    
}