SHARE
TWEET

Untitled

a guest Mar 19th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <BT.h>
  2. #bit TMR2IF = 0x0C.1
  3. void main()
  4. { int8 LED[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
  5.   int i=0;
  6.   int dem =0;
  7.   set_tris_d(0);  
  8.   set_tris_b(0);
  9.   set_tris_c(0xff);
  10.   TMR2IF=0;
  11.    while(TRUE)
  12.    {
  13.       output_d(LED[i]);    
  14.       setup_timer_2(T2_DIV_BY_1,251,5);
  15.       output_bit(PIN_B0,!input(PIN_C2));
  16.       while (dem <= 125)
  17.       {
  18.         if (TMR2IF==1)
  19.         {dem ++;
  20.          TMR2IF=0;
  21.          set_timer2(1);};
  22.       }
  23.        
  24.       dem=0;
  25.       i++;
  26.       if (i==10) i=0;
  27.  
  28.       //TODO: User Code
  29.    }
  30.  
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top