Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "msp430x14x.h"
- typedef unsigned char byte;
- #define P4IN *((byte *)0x1C)
- #define P4OUT *((byte *)0x1D)
- #define P4DIR *((byte *)0x1E)
- #define P2IN *((byte *)0x28)
- #define P2OUT *((byte *)0x29)
- #define P2DIR *((byte *)0x2A)
- int main (void){
- WDTCTL = WDTPW + WDTHOLD;
- P4DIR |= 0x00;
- P4DIR |= 0x04;
- P2DIR |= 0x02;
- //P2OUT = P2OUT | 0x02;
- while(1==1)
- {
- if((P4IN & 0x10) != 0)
- {
- P2OUT = P2OUT | 0x02;
- }else{
- P2OUT ^= 0x02;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement