Advertisement
Guest User

valy regele femeilor

a guest
Mar 3rd, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. /*
  2. * File: toamaVaca.c
  3. * Author: student
  4. *
  5. * Created on March 3, 2015, 4:53 PM
  6. */
  7.  
  8.  
  9. #include <p24ep256mc202.h>
  10. #include <stdlib.h>
  11. #include <stdio.h>
  12.  
  13.  
  14. unsigned long contor=0;
  15. unsigned long limita=0;
  16.  
  17. void __attribute__((interrupt, no_auto_psv))_T2INterrupt(void)
  18. {
  19. IFS0bits.T2IF=0;
  20. contor++;
  21. }
  22.  
  23. int main(int argc, char **argv)
  24. {
  25. TRISBbits.TRISB15=0;
  26. TMR2=0;
  27. PR2=35;
  28. T2CONbits.TCKPS=1;
  29. T2CONbits.TON=1;
  30. IPC1bits.T2IP=1;
  31. IFS0bits.T2IF=0;
  32. IEC0bits.T2IE=1;
  33. while(1)
  34. {
  35. if (contor>=limita)
  36. {
  37. limita+=1;
  38. LATBbits.LATB15^=1;
  39. }
  40. }
  41. return(EXIT_SUCCESS);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement