Advertisement
Latkoski

Lab01p01

Dec 10th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. int broj=1;
  2. void main() {
  3. TRISB = 0;
  4.  
  5. PORTB.B1 = 0XFF;
  6. broj+=3;
  7. broj%=8;
  8. delay_ms(10);
  9. PORTB.B1 = 0;
  10.  
  11. while(1){
  12. if(broj == 0){
  13. PORTB.b0 = 0xff;
  14. broj+=3;
  15. broj%=8;
  16. delay_ms(10);
  17. PORTB.B0 = 0;
  18. continue;
  19. }
  20.  
  21. else if(broj == 1){
  22. PORTB.B1 = 0xff;
  23. break;
  24. }
  25.  
  26. else if(broj == 2){
  27. PORTB.B2 = 0XFF;
  28. broj+=3;
  29. broj%=8;
  30. delay_ms(10);
  31. PORTB.B2 = 0;
  32. continue;
  33. }
  34. else if(broj == 3){
  35. PORTB.B3 = 0XFF;
  36. broj+=3;
  37. broj%=8;
  38. delay_ms(10);
  39. PORTB.B3 = 0;
  40. continue;
  41. }
  42. else if(broj == 4){
  43. PORTB.B4 = 0XFF;
  44. broj+=3;
  45. broj%=8;
  46. delay_ms(10);
  47. PORTB.B4 = 0;
  48. continue;
  49. }
  50. else if(broj == 5){
  51. PORTB.B5 = 0XFF;
  52. broj+=3;
  53. broj%=8;
  54. delay_ms(10);
  55. PORTB.B5 = 0;
  56. continue;
  57.  
  58. }
  59. else if(broj == 6){
  60. PORTB.B6 = 0XFF;
  61. broj+=3;
  62. broj%=8;
  63. delay_ms(10);
  64. PORTB.B6 = 0;
  65. continue;
  66. }
  67. else if(broj == 7){
  68. PORTB.B7 = 0XFF;
  69. broj+=3;
  70. broj%=8;
  71. delay_ms(10);
  72. PORTB.B7 = 0;
  73. continue;
  74. }
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement