Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<msp430x14x.h>
- void main(void)
- {
- WDTCTL = WDTPW + WDTHOLD; // Zatrzymanie watchdog timera
- P4DIR &= ~0x10;
- P4DIR &= ~0x20;
- P4DIR &= ~0x40;
- P2DIR |= 0x02;
- P1DIR |= 0x20;
- P1DIR |= 0x40;
- while(1==1)
- {
- if((P4IN & 0x10)!=0)
- {
- P2OUT |=0x02;
- }
- else
- {
- P2OUT &= ~0x02;
- }
- if((P4IN & 0x20)!=0)
- {
- P1OUT &= ~0x20;
- }
- else
- {
- P1OUT |=0x20;
- }
- if((P4IN & 0x40)!=0)
- {
- P1OUT &= ~0x40;
- }
- else
- {
- P1OUT |=0x40;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment