標題: 小車 [打印本頁]

作者: 學海無涯回頭吧    時間: 2017-8-30 17:13
標題: 小車
#include <REG51.H>
sbit zou=P1^1;
int n=0,l,Q;
void zh()
        interrupt 1
{
  TH0=(65536-10)/256;
        TL0=(65536-10)%256;
        n++;
        if(n<91)
        {zou=1;}
        else if(n>=91)
        {zou=0;}
        if(n==200)
        {n=0;}
}
void main()
{
  TMOD=0x01;
        TH0=(65535-10)/256;
        TL0=(65535-10)%256;
        EA=1;
        ET0=1;
        TR0=1;
        while(1)
        {
          
}
}

       






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