a

Dependencies:   LM75B mbed

main.cpp

Committer:
bulmenwt
Date:
2015-01-28
Revision:
0:be4a058fa6f8

File content as of revision 0:be4a058fa6f8:

/*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);
    }
}