Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include<18f8720.h> //dodanie biblioteki
  2. #pragma use standard_io(d) //zmienia kierunkowość portów automatycznie
  3. #pragma fuses HS,NOWDT,NOLVP,MCU //bity konfiguracyjne
  4. #pragma case
  5. #pragma use delay (clock=10000000) //fumkcja opozienia
  6. main()
  7. {
  8. int x=1;
  9. int y = 1;
  10. while(true)
  11. {
  12. output_d(x);
  13. delay_ms(200);
  14.  
  15. if(x >= 128)
  16. {
  17. y = y * (-1);
  18. }
  19. if(y == 1)
  20. {
  21. x = x * 2;
  22. }
  23. else
  24. {
  25. x = x / 2;
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement