Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int broj=1;
- void main() {
- TRISB = 0;
- PORTB.B1 = 0XFF;
- broj+=3;
- broj%=8;
- delay_ms(10);
- PORTB.B1 = 0;
- while(1){
- if(broj == 0){
- PORTB.b0 = 0xff;
- broj+=3;
- broj%=8;
- delay_ms(10);
- PORTB.B0 = 0;
- continue;
- }
- else if(broj == 1){
- PORTB.B1 = 0xff;
- break;
- }
- else if(broj == 2){
- PORTB.B2 = 0XFF;
- broj+=3;
- broj%=8;
- delay_ms(10);
- PORTB.B2 = 0;
- continue;
- }
- else if(broj == 3){
- PORTB.B3 = 0XFF;
- broj+=3;
- broj%=8;
- delay_ms(10);
- PORTB.B3 = 0;
- continue;
- }
- else if(broj == 4){
- PORTB.B4 = 0XFF;
- broj+=3;
- broj%=8;
- delay_ms(10);
- PORTB.B4 = 0;
- continue;
- }
- else if(broj == 5){
- PORTB.B5 = 0XFF;
- broj+=3;
- broj%=8;
- delay_ms(10);
- PORTB.B5 = 0;
- continue;
- }
- else if(broj == 6){
- PORTB.B6 = 0XFF;
- broj+=3;
- broj%=8;
- delay_ms(10);
- PORTB.B6 = 0;
- continue;
- }
- else if(broj == 7){
- PORTB.B7 = 0XFF;
- broj+=3;
- broj%=8;
- delay_ms(10);
- PORTB.B7 = 0;
- continue;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement