Pic rogramlama ccs c RB0 kesme örnek kodlar ve devresi
#include <16f877a.h>
#fuses XT,NOWDT,NOPROTECT,NOBROWNOUT,NOLVP,NOPUT,NOWRT,NODEBUG,NOCPD
#use delay (clock=4000000)
#use fast_io(b)
#int_ext
void ext_kesmesi ()
{
output_high(pin_c0);
delay_ms(5000);
output_high(pin_c7);
}
void main()
{
set_tris_b(0x01);
output_b(0x00);
set_tris_c(0x00);
output_c(0x00);
//ext_int_edge(H_TO_L);
enable_interrupts(INT_EXT);
enable_interrupts(GLOBAL);
while(true)
{
if(input(pin_a0) == 1)
{
output_low(pin_c0);
output_low(pin_c7);
}
}
}
Hiç yorum yok:
Yorum Gönder
Her yorum bilgidir. Araştırmaya devam...