M0Board_WF
/
WF_taster_interrupt
a
Diff: main.cpp
- Revision:
- 0:be4a058fa6f8
diff -r 000000000000 -r be4a058fa6f8 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jan 28 07:55:24 2015 +0000 @@ -0,0 +1,32 @@ +/*M0-BOARD LPC11U24 VERSION 1.0 WF 01_2015 +BULME Graz / Elektronik + +Polling eines Tasters + +Datei: WF_taster_interrupt/main.cpp + +*/ + +#include "mbed.h" +InterruptIn sw2(P0_10); // Taste sw2 +DigitalOut led(LED1); + +DigitalOut secled(P1_12); // LED für Sekundentag + +//// Interruptfunktion push1 +void push1() +{ + led = !led; +} + +// Hauptprogramm +int main() +{ + sw2.rise(&push1); // attach the address of the push function to the rising edge + + while(1) // Endlosschleife + { + secled = !secled; // Sekundenanzeige + wait(0.5); + } +} \ No newline at end of file