Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <18F452.h>
- #use delay (clock = 20000000)
- #fuses HS, NOWDT, NOLVP
- #define myDelay 500
- int *TRISB = 0xF93, *PORTB = 0xF81; // Data Sheet... Page 47.
- main(){
- *TRISB = 0x00;
- *PORTB = 0x01; // Make all my lights OFF.
- while(1){
- while(*PORTB < 0x08){
- *PORTB = *PORTB << 1;
- delay_ms(myDelay);}
- while(*PORTB > 0x01){
- *PORTB = *PORTB >> 1;
- delay_ms(myDelay);}
- }
- }
Add Comment
Please, Sign In to add comment