亮灭
用按键控制ED灯的亮灭
用按键控制LED灯的亮灭,当按键按下时,LED灯亮,当按键松开时,LED灯灭。#include"msp430f6638.h"unsigned char flag;void main(void){WDTCTL = WDTPW+WDTHOLD; // Stop WDTP4DIR &=~(BIT2);P4DIR |= BIT4+BIT5+BIT6; // P4.4...
用按键控制LED灯的亮灭,当按键按下时,LED灯亮,当按键松开时,LED灯灭。#include"msp430f6638.h"unsigned char flag;void main(void){WDTCTL = WDTPW+WDTHOLD; // Stop WDTP4DIR &=~(BIT2);P4DIR |= BIT4+BIT5+BIT6; // P4.4...