MSP430F249GPIO控制入门
扫描二维码
随时随地手机看文章
#include "MSP430x24x.h"
void main(void)
{
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD; //关狗
P4DIR = BIT0|BIT1|BIT2|BIT3; //设置为输出
P4SEL = 0;
while(1)
{
volatile unsigned int i;
P4OUT ^= 0x0F; //电平翻转
i = 50000; // Delay
do (i--);
while (i != 0);
}
}