Guest User

Untitled

a guest
Jul 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <18F452.h>
  2. #use delay (clock = 20000000)
  3. #fuses HS, NOWDT, NOLVP
  4. #define myDelay 500
  5.  
  6. int *TRISB = 0xF93, *PORTB = 0xF81; // Data Sheet... Page 47.
  7. main(){
  8. *TRISB = 0x00;
  9. *PORTB = 0x01; // Make all my lights OFF.
  10. while(1){
  11. while(*PORTB < 0x08){
  12. *PORTB = *PORTB << 1;
  13. delay_ms(myDelay);}
  14. while(*PORTB > 0x01){
  15. *PORTB = *PORTB >> 1;
  16. delay_ms(myDelay);}
  17. }
  18. }
Add Comment
Please, Sign In to add comment