Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <BT.h>
- #bit TMR2IF = 0x0C.1
- void main()
- { int8 LED[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
- int i=0;
- int dem =0;
- set_tris_d(0);
- set_tris_b(0);
- set_tris_c(0xff);
- TMR2IF=0;
- while(TRUE)
- {
- output_d(LED[i]);
- setup_timer_2(T2_DIV_BY_1,251,5);
- output_bit(PIN_B0,!input(PIN_C2));
- while (dem <= 125)
- {
- if (TMR2IF==1)
- {dem ++;
- TMR2IF=0;
- set_timer2(1);};
- }
- dem=0;
- i++;
- if (i==10) i=0;
- //TODO: User Code
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement