mikrobasic button led code sample
 
    Mikro basic ve MikroC derleyici örnek kodlarında port bazlı buton led örnekleri verilmiş, aynı portta buton led örneği yoktu bu nedsenle hazırlamak istedim. Portc 2. bitine buton, 0 bitine ise led bağlanmış durumda.  Derleyicide buton kütüphanesi seçilmeli.   program Button_Test   dim eskidurum as byte   main:    ANSELA = 0   'A PORTU ADC KAPATILDI    ANSELB = 0   'B PORTU ADC KAPATILDI    ANSELC = 0   'C PORTU ADC KAPATILDI     TRISC2_bit = 1 'PORTC.2 BİTİ GİRİŞ OLARAK AYARLANDI    TRISC0_bit = 0 'PORTC.0 BİTİ ÇIKIŞ OLARAK AYARLANDI    LATC = 0       'PORTC SIFIRLANDI     eskidurum = 0 'DURUM DEĞİŞKENİ     while TRUE      if (Button(PORTC, 2, 1, 1)) then ' POTRC 2. BİTİNİ KONTROL ET        eskidurum = 1        LATC.0 = 0      end if      if (eskidurum and Button(PORTC, 2, 1, 0)) then 'PORTC2 PİNİNİN 1-0 DURUMUNU KONTROL ET  ...
 








 
 
