Dersler
/
Nucleo_InterruptIn_counter
InterruptIn örneği
Fork of InterruptIn_HelloWorld by
Embed:
(wiki syntax)
Show/hide line numbers
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 }
Generated on Tue Jul 12 2022 21:02:07 by 1.7.2