標題: 單片機控制8字閃燈Proteus仿真程序 [打印本頁]

作者: duanl123456    時間: 2020-2-15 17:26
標題: 單片機控制8字閃燈Proteus仿真程序
#include<reg51.h>
#define uint16 unsigned int
int i;
void delay(uint16 t)
{
        uint16 a;
        for(;t>0;t--)
                for(a=123;a>0;a--);
                                }
void main()
{
P1 = 0x00;
P2 = 0x00;

if(P2^0 == 1) {
while(1)
{
delay(500);
P1 = 0xff;
P3 = 0xff;
delay(500);
P1 = 0x3f;
P3 = 0x00; }
}                  
}

1581758638(1).png (14.71 KB, 下載次數(shù): 31)

1581758638(1).png

一燈控制8閃.zip

47.69 KB, 下載次數(shù): 3, 下載積分: 黑幣 -5






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