访问手机版页面
你的位置:老古开发网 > MSP430驱动LCD显示 > 正文  
MSP430流水灯Ⅰ
内容导读:
#include unsigned char LED; unsigned int table[8] = {BIT0,BIT1,BIT2,BIT3,BIT4,BIT5,BIT6,BIT7}; void main( void ) { // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD; LED = 0

#include

unsigned char LED;

unsigned int table[8] = {BIT0,BIT1,BIT2,BIT3,BIT4,BIT5,BIT6,BIT7};

void main( void )

{

// Stop watchdog timer to prevent time out reset

WDTCTL = WDTPW + WDTHOLD;

LED = 0XFF;

P2DIR = 0XFF;

P2OUT = LED;

while(1)

{

unsigned int i,j;

for(i=0;i<8;i++)

{

LED = LED ^table[i];

P2OUT = LED;

LED = 0XFF;

j = 50000;

while(j--);

}

for(i=0;i<8;i++)

{

// LED ^= table[8-i];

LED ^= table[7-i];

P2OUT = LED;

LED = 0XFF;

j = 50000;

while(j--);

}

}

}


标签: MSP430,流水灯,
来源:互联网 作者:karen 时间:2019/1/9 11:20:01
相关阅读
推荐阅读
阅读排行
最近更新
商品推荐