#include <msp430f5529.h>
void Delay(unsigned int ms);
/**
* main.c
*/
int main(void)
{
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
P4DIR |= BIT7; //P4.7输出模式
P1DIR |= BIT0; //P1.0输出模式
while(1)
{
P4OUT |= BIT7; P1OUT &= ~BIT0;
Delay(500);
P1OUT |= BIT0; P4OUT &= ~BIT7;
Delay(500);
}
return 0;
}
//===============================================
void Delay(unsigned int ms)
{
unsigned int i,j;
for (i=0;i<ms;i++) { for(j=0; j<215; j++); }
}
|