標(biāo)題: MSP430F5529LP板上兩燈交替閃爍程序,需要的拿去 [打印本頁]

作者: yanzq    時間: 2019-5-26 22:24
標(biāo)題: MSP430F5529LP板上兩燈交替閃爍程序,需要的拿去
#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++); }
}



作者: 超超超超    時間: 2021-5-18 23:42
不管用呀




歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1