MSP430 4*4键盘 #include /* * main.c */ void main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer P2DIR = BIT0; P2OUT = BIT0; char temp = 0; int a,X,Y; while(1) { P1DIR = BIT0 + BIT1 + BIT2 + BIT3; P1OUT = BIT0 + BIT1 + BIT2 + BIT3; if(P1IN&BIT4;) {for(a=8000;a>0;