External Interrupt example for WIZwiki-W7500 Academy
Dependencies: mbed
Fork of GPIOIn_INT_HelloWorld_WIZwiki-W7500 by
Diff: main.cpp
- Revision:
- 10:e47e799ccc98
- Parent:
- 9:7c19b19301c5
--- a/main.cpp Wed Jan 06 06:36:42 2016 +0000 +++ b/main.cpp Wed Feb 03 07:21:45 2016 +0000 @@ -2,21 +2,24 @@ #include "mbed.h" -InterruptIn mysw(D10); // push switch 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 - myled_B = !myled_B; // Blue LED Toggle with rising edge -} +void exin(); // interrupt function int main() { - mysw.rise(&exin); // attach the address of the exin function to the rising edge + mysw.rise(&exin); // attach the address of the exin function to the rising edge - while(1) { - myled_R = !myled_R; // Red LED switching continuosly + 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 } \ No newline at end of file