標(biāo)題: 單片機(jī)汽車(chē)轉(zhuǎn)向燈 仿真圖+源代碼 [打印本頁(yè)]

作者: 千萬(wàn)11    時(shí)間: 2022-8-27 10:01
標(biāo)題: 單片機(jī)汽車(chē)轉(zhuǎn)向燈 仿真圖+源代碼
程序:
#include<at89x51.h>
sbit left1=P0^0;
sbit left2=P0^1;
sbit right1=P0^2;
sbit right2=P0^3;
sbit L=P1^0;
sbit R=P1^1;
void delay(unsigned int i)
{
   while(i--);
}
void main()
{
   while(1)
   {
      P1=0XFF;
          left1=L;left2=L;
          right1=R;right2=R;
          delay(2000);
          left1=1;left2=1;
          right1=1;right2=1;
          delay(2000);
   }








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