当前位置:首页 > 建筑/环境 > 工程监理 > msp430流水灯程序
#includemsp430g2553.h#defineuintunsignedint#defineucharunsignedcharvoidys(uintz){while(z--);}voidmain()//按字节操作{WDTCTL=WDTPW+WDTHOLD;P1DIR|=BIT0;//输出模式P1DIR|=BIT0;P1DIR|=BIT1;P1DIR|=BIT2;P1DIR|=BIT3;P1DIR|=BIT4;P1DIR|=BIT5;P1DIR|=BIT6;P1DIR|=BIT7;while(1){P1OUT=0xfe;ys(30000);P1OUT=0xfd;ys(30000);P1OUT=0xfb;ys(30000);P1OUT=0xf7;ys(30000);P1OUT=0xef;ys(30000);P1OUT=0xdf;ys(30000);P1OUT=0xbf;ys(30000);P1OUT=0x7f;ys(30000);P1OUT=0xbf;ys(30000);P1OUT=0xdf;ys(30000);P1OUT=0xef;ys(30000);P1OUT=0xf7;ys(30000);P1OUT=0xfb;ys(30000);P1OUT=0xfd;ys(30000);}}
共162篇文档
格式: doc
大小: 27.5 KB
时间: 2020-12-27
本文标题:msp430流水灯程序
链接地址:https://www.777doc.com/doc-7331747 .html