InterruptIn örneği

Fork of InterruptIn_HelloWorld by mbed_example

main.cpp

Committer:
ctasdemir
Date:
2018-05-11
Revision:
5:62afaa6c5cb9
Parent:
3:f729f0421740
Child:
6:0fa52feea38a

File content as of revision 5:62afaa6c5cb9:

#include "mbed.h"



volatile int count = 0;
InterruptIn interrupt(USER_BUTTON);

void increment() {
        count++;
    }

int main() {
    
    interrupt.fall(&increment); // increment fonksiyonunu kesmeye bağlıyoruz
    while(1) {
        printf("Sayac degeri %d\n", count);
        wait(2);
    }
}