#include <msp430.h>
//按下亮,松开灭
/**
* main.c
*/
int main(void)
{
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
DCOCTL = 0;
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;
P1DIR |= BIT6;
P1DIR &= ~BIT3;
P1REN |= BIT3;
while(1)
{
if(!(BIT3 & P1IN))
P1OUT |= BIT6;
else
P1OUT &= ~BIT6;
}
return 0;
}8:51 2020/12/20