hibbzboi

Jedna diodka

Mar 22nd, 2016
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <p24fj128ga010.h>
  2.  
  3. _CONFIG1(JTAGEN_OFF & GCP_OFF & GWRP_OFF & BKBUG_OFF & COE_OFF & FWDTEN_OFF)
  4. _CONFIG2(FCKSM_CSDCMD & OSCIOFNC_ON & POSCMOD_HS & FNOSC_PRI)
  5.  
  6. #define SCALE 308L
  7.  
  8. int main(void)
  9. {
  10. unsigned long i;
  11. unsigned char display=1;
  12. PORTA=0x0000;
  13. TRISA=0xFF00;
  14. TRISD=0xFFFF;
  15. display = 1;
  16.  
  17. wLewo:
  18. Nop();
  19. PORTA=(unsigned int) display;
  20. for(i=500L*SCALE;i>0;i--) Nop();
  21. if(display == 128)
  22. goto wPrawo;
  23. else
  24. display = display * 2;
  25. goto wLewo;
  26.  
  27.  
  28. wPrawo:
  29. Nop();
  30. PORTA=(unsigned int) display;
  31. for(i=500L*SCALE;i>0;i--) Nop();
  32. if(display == 1)
  33. {
  34. display = display * 2;
  35. goto wLewo;
  36. }
  37. else
  38. display=display / 2;
  39. goto wPrawo;
  40. }
Add Comment
Please, Sign In to add comment