External Interrupt example for WIZwiki-W7500 Academy

Dependencies:   mbed

Fork of GPIOIn_INT_HelloWorld_WIZwiki-W7500 by Lawrence Lee

Committer:
joon874
Date:
Thu Jul 02 23:09:43 2015 +0000
Revision:
1:95b6d8c7bb10
Parent:
0:4052805e9292
Child:
2:77994200971e
comment change

Who changed what in which revision?

UserRevisionLine numberNew contents of line
joon874 0:4052805e9292 1 /* Digital External Interrupt Example Program */
joon874 0:4052805e9292 2
joon874 0:4052805e9292 3 #include "mbed.h"
joon874 0:4052805e9292 4
joon874 0:4052805e9292 5 InterruptIn mysw(D10);
joon874 0:4052805e9292 6 DigitalOut myled1(LED1);
joon874 0:4052805e9292 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 0:4052805e9292 16 while(1) { // wait around, interrupts will interrupt this!
joon874 0:4052805e9292 17 myled1 = !myled1;
joon874 0:4052805e9292 18 wait(1.0);
joon874 0:4052805e9292 19 }
joon874 0:4052805e9292 20
joon874 1:95b6d8c7bb10 21 }
joon874 1:95b6d8c7bb10 22
joon874 1:95b6d8c7bb10 23