External Interrupt example for WIZwiki-W7500 Academy

Dependencies:   mbed

Fork of GPIOIn_INT_HelloWorld_WIZwiki-W7500 by Lawrence Lee

main.cpp

Committer:
IOP
Date:
2016-02-03
Revision:
10:e47e799ccc98
Parent:
9:7c19b19301c5

File content as of revision 10:e47e799ccc98:

/* GPIO Input Interrupt Example Program */
 
#include "mbed.h"

DigitalOut myled_R(LED_RED);     // LED_RED on WIZwiki-W7500
DigitalOut myled_B(LED_BLUE);    // LED_BLUE on WIZwiki-W7500

InterruptIn mysw(D10);           // push switch

 
void exin();                     // interrupt function
 
int main() {
    
    mysw.rise(&exin);            // attach the address of the exin function to the rising edge
    
    while(1){                
        myled_R = !myled_R;      // Red LED switching continuosly
        wait(0.5);      
    }   
}

void exin(){                    
    myled_B = !myled_B;          // Blue LED Toggle with rising edge
}