MarVin666

trzecie

Sep 29th, 2015
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include<msp430x14x.h>
  2.  
  3. void main(void)
  4. {
  5.  
  6. WDTCTL = WDTPW + WDTHOLD; // Zatrzymanie watchdog timera
  7.  
  8. P4DIR &= ~0x10;
  9. P4DIR &= ~0x20;
  10. P4DIR &= ~0x40;
  11. P2DIR |= 0x02;
  12. P1DIR |= 0x20;
  13. P1DIR |= 0x40;
  14.  
  15. while(1==1)
  16. {
  17. if((P4IN & 0x10)!=0)
  18. {
  19. P2OUT |=0x02;
  20. }
  21.  
  22. else
  23. {
  24. P2OUT &= ~0x02;
  25. }
  26. if((P4IN & 0x20)!=0)
  27. {
  28. P1OUT &= ~0x20;
  29. }
  30.  
  31. else
  32. {
  33. P1OUT |=0x20;
  34. }
  35. if((P4IN & 0x40)!=0)
  36. {
  37. P1OUT &= ~0x40;
  38. }
  39.  
  40. else
  41. {
  42. P1OUT |=0x40;
  43. }
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment