Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1.     TRISB = 0x00;    //  set direction of RBO to output OxFE = 11111110 all other pins (RB1 - RB7) are input pins
  2.     PORTB = 1;       // Set RB0 to high 00000001
  3.  
  4.     do              // To set infinite loop
  5.     {
  6.       Delay_ms(300);          // 350 mili seconds delay
  7.       PORTB = PORTB<<1;       //Shifting right by one bit
  8.       if(PORTB >= 0b10000000) //To reset to 00000001 when the count becomes 10000000
  9.       {
  10.          Delay_ms(350);       // 350 mili seconds delay
  11.          PORTB = 1;
  12.       }
  13.     }while(1);      // To set infinite loop
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement