External Interrupt example for WIZwiki-W7500 Academy

Dependencies:   mbed

Fork of GPIOIn_INT_HelloWorld_WIZwiki-W7500 by Lawrence Lee

Committer:
joon874
Date:
Thu Jul 09 04:20:58 2015 +0000
Revision:
4:296a62c9cb15
Parent:
3:f3fffb66c845
Child:
6:41c9ebdce05b
GPIO Input Interrupt for WIZwiki-W7500 Academy

Who changed what in which revision?

UserRevisionLine numberNew contents of line
joon874 3:f3fffb66c845 1 /* GPIO Input Interrupt Example Program */
joon874 4:296a62c9cb15 2
joon874 0:4052805e9292 3 #include "mbed.h"
joon874 0:4052805e9292 4
joon874 4:296a62c9cb15 5 InterruptIn mysw(D10);
joon874 4:296a62c9cb15 6 DigitalOut myled1(LED1);
joon874 4:296a62c9cb15 7 DigitalOut myled2(LED2);
joon874 0:4052805e9292 8
joon874 0:4052805e9292 9 void exin(){
joon874 0:4052805e9292 10 myled2 = !myled2;
joon874 0:4052805e9292 11 }
joon874 0:4052805e9292 12
joon874 0:4052805e9292 13 int main() {
joon874 0:4052805e9292 14
joon874 1:95b6d8c7bb10 15 mysw.rise(&exin); // attach the address of the exin function to the rising edge
joon874 4:296a62c9cb15 16 while(1) { // wait around, interrupts will interrupt this!
joon874 4:296a62c9cb15 17 myled1 = !myled1;
joon874 4:296a62c9cb15 18 wait(1.0);
joon874 4:296a62c9cb15 19 }
joon874 4:296a62c9cb15 20
joon874 4:296a62c9cb15 21 }