標(biāo)題: ..\MAIN.C(85): ′íÎó C141: syntax error near '=' 關(guān)于這個(gè)錯(cuò)誤的問(wèn)題 [打印本頁(yè)]

作者: 素還真    時(shí)間: 2018-5-2 11:09
標(biāo)題: ..\MAIN.C(85): ′íÎó C141: syntax error near '=' 關(guān)于這個(gè)錯(cuò)誤的問(wèn)題
void RST() interrupt 2
{
        EX0=0;
        P2=0;P3^2=1;
        EN1=1;EN2=1;EN3=1;EN4=1;
        while(P3^2)
                P2^1=1;
        P2=0;P3^2=1;
        while(P3^2)
                P2^3=1;
        P2=0;P3^2=1;
        while(P3^2)
                P2^5=1;
        P2=0;P3^2=1;
        while(P3^2)
                P2^7=1;
}
是不能直接給單個(gè)的io口賦值嗎,還是別的原因。
——————————————————————————————————————————————————
sbit q=P2^0;
sbit w=P2^2;
sbit e=P2^4;
sbit r=P2^6;


                EX0=1;
                GETAD_data();
                P2=0;
                if(a>2.5)
                        q=1;
                else if(a<2.5)
                        w=1;
                else if(a==2.5)
                        _nop_();
               
                if(b>2.5)
                        e=1;
                else if(b<2.5)
                        r=1;
                else if(b==2.5)
                        _nop_();
               
                delay_ms(10);

這樣寫(xiě)就沒(méi)有報(bào)錯(cuò)。上傳了全部代碼。

main.docx

13.83 KB, 下載次數(shù): 5






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