InterruptIn örneği

Fork of InterruptIn_HelloWorld by mbed_example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 volatile int count = 0;
00004 InterruptIn interrupt(USER_BUTTON);
00005 
00006 void increment() {
00007         count++;
00008     }
00009 
00010 int main() {
00011     
00012     interrupt.fall(&increment); // increment fonksiyonunu kesmeye bağlıyoruz
00013     while(1) {
00014         printf("Sayac degeri %d\n", count);
00015         wait(2);
00016     }
00017 }