Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. void main() {
  2.  
  3. int value;
  4. int counter=0;
  5.  
  6. ansel=0;
  7. anselh=0;
  8. trisa=0x00;
  9. trisb=0x00;
  10. porta=0x00;
  11. value=0b10000000;
  12.  
  13. while(1){
  14.  
  15. if(value==0){
  16. value=0b10000000;
  17. counter=0;
  18. }
  19.  
  20. porta = value;
  21.  
  22. if(counter==2){
  23. value = value >> 1;
  24. counter = 0;
  25. } else {
  26. value = value << 1;
  27. counter++;
  28. }
  29.  
  30. Delay_ms(20);
  31.  
  32. }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement