標(biāo)題:
Protues仿真實(shí)例(8051)-流水燈演示
[打印本頁(yè)]
作者:
1613130717
時(shí)間:
2017-12-23 21:17
標(biāo)題:
Protues仿真實(shí)例(8051)-流水燈演示
Protues仿真實(shí)例(8051)-流水燈演示
QQ截圖20171223211700.png
(79.59 KB, 下載次數(shù): 38)
下載附件
2017-12-23 21:16 上傳
單片機(jī)源程序如下:
#include <REGX52.H>
void Delay1ms(unsigned int count)
{
unsigned int i,j;
for(i=0;i<count;i++)
for(j=0;j<120;j++);
}
main()
{
unsigned char LEDIndex = 0;
bit LEDDirection = 1;
while(1)
{
if(LEDDirection)
P1 = ~(0x01<<LEDIndex);
else
P1 = ~(0x80>>LEDIndex);
if(LEDIndex==7)
LEDDirection = !LEDDirection;
LEDIndex = (LEDIndex+1)%8;
Delay1ms(100);
}
}
復(fù)制代碼
所有資料51hei提供下載:
Protues仿真實(shí)例(8051)-流水燈演示.zip
(67.92 KB, 下載次數(shù): 7)
2017-12-23 21:17 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1