Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <16f877.h>
- #use delay(clock=1M)
- int8 kesmesayac=0;
- #INT_TIMER1
- void t1kesme(){ //KS=(65536-3036)x4x4/1M=1sn
- set_timer1(3036);
- kesmesayac++;
- if(kesmesayac%3==0){ //3sn'de bir bu if'e girecek
- output_toggle(PIN_C0);
- }
- if(kesmesayac%5==0){ //5sn'de bir bu if'e girecek
- output_toggle(PIN_C1);
- }
- if (kesmesayac==15) kesmesayac=0;
- }
- void main(){
- output_low(PIN_C0);
- output_low(PIN_C1);
- setup_timer_1(T1_INTERNAL | T1_DIV_BY_4);
- set_timer1(3036);
- enable_interrupts(INT_TIMER1);
- enable_interrupts(GLOBAL);
- while(true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement