diff --git a/libraries/tests/mbed/interruptin_2/main.cpp b/libraries/tests/mbed/interruptin_2/main.cpp index 7726883d72..7768f77b0b 100644 --- a/libraries/tests/mbed/interruptin_2/main.cpp +++ b/libraries/tests/mbed/interruptin_2/main.cpp @@ -13,6 +13,21 @@ InterruptIn button8(p10); InterruptIn button9(p9); DigitalOut led(LED1); DigitalOut flash(LED4); + +#elif defined(TARGET_LPC1114) +InterruptIn button(p30); // SW2 (User switch) +InterruptIn button1(p5); +InterruptIn button2(p6); +InterruptIn button3(p7); +InterruptIn button4(p9); +InterruptIn button5(p10); +InterruptIn button6(p12); +InterruptIn button7(p13); +InterruptIn button8(p14); +InterruptIn button9(p15); +DigitalOut led(LED1); +DigitalOut flash(LED2); + #else InterruptIn button(p30); InterruptIn button1(p29); @@ -33,6 +48,11 @@ void flip() { } int main() { + flash = 0; + led = 0; +#if defined(TARGET_LPC1114) + button.mode(PullUp); +#endif button.rise(&flip); // attach the address of the flip function to the rising edge button1.rise(&flip); button2.rise(&flip); @@ -43,6 +63,7 @@ int main() { button7.rise(&flip); button8.rise(&flip); button9.rise(&flip); + while(1) { // wait around, interrupts will interrupt this! flash = !flash; wait(0.25);