把下面C语言转换成VB语言
voidmain(void){restart—flag=l:EnableXInterrupt:While(1)if(engine—runningpower—on—flag...
void main(void)
{restart—flag=l:
EnableXInterrupt:
While(1)
if(engine—running power—on—flag==O)
{
i f(power—on—f l ag==O)
{
initialize():
if(1 engine—running)
{
Clutch—off(Empty—Rate):
Gear Case Reset();
}
engine—running=1:
power—on—flag=l:
)
el se power—on—flag=l:
EnableInterruptS;
delay(5000):
for(::)
{read一165():
if(manual auto==AUTO)
{
Gun—peda l—track():
wh i 1 e(f forward—gear&&none—gear
&&back—gear&&manual—auto&&key—on)
Forward(): //前进档处理
whi 1 e(!none—gear&&forward~gear
&&back—gear&&manual—auto&&key一0n)
Nonegear(): //空档处理
wh i l e(!back—gear&&forward—gear
&&none—gear&&manual—auto&&key—on)
Backward(): //倒档处理
i f(back—gear+none—gear+forward—gear<2)
ERR—analysiS(SHIFT—HANDLE—ERROR);
if(I key—on&&!fire)park()://停车
delay(100):
goto 1abel: 展开
{restart—flag=l:
EnableXInterrupt:
While(1)
if(engine—running power—on—flag==O)
{
i f(power—on—f l ag==O)
{
initialize():
if(1 engine—running)
{
Clutch—off(Empty—Rate):
Gear Case Reset();
}
engine—running=1:
power—on—flag=l:
)
el se power—on—flag=l:
EnableInterruptS;
delay(5000):
for(::)
{read一165():
if(manual auto==AUTO)
{
Gun—peda l—track():
wh i 1 e(f forward—gear&&none—gear
&&back—gear&&manual—auto&&key—on)
Forward(): //前进档处理
whi 1 e(!none—gear&&forward~gear
&&back—gear&&manual—auto&&key一0n)
Nonegear(): //空档处理
wh i l e(!back—gear&&forward—gear
&&none—gear&&manual—auto&&key—on)
Backward(): //倒档处理
i f(back—gear+none—gear+forward—gear<2)
ERR—analysiS(SHIFT—HANDLE—ERROR);
if(I key—on&&!fire)park()://停车
delay(100):
goto 1abel: 展开
2个回答
展开全部
restart_flag=l
' EnableXInterrupt:
While(1)
if (Egine_running ) THEN
power_on_flag=O
i f(power_on_f l ag=O)
END IF
SUB Ainitialize()
if 1 THEN
engine_running
Clutch_off(Empty_Rate)
Gear Case Reset()
END IF
engine_running=1
power_on_flag=l
''''''''''''''''''''''''''''''''''''''''''''就这样改的 都差不多的 不知道你的原来的程序有没错啊
el se power—on—flag=l:
EnableInterruptS;
delay(5000):
for(::)
{read一165():
if(manual auto==AUTO)
{
Gun—peda l—track():
wh i 1 e(f forward—gear&&none—gear
&&back—gear&&manual—auto&&key—on)
Forward(): //前进档处理
whi 1 e(!none—gear&&forward~gear
&&back—gear&&manual—auto&&key一0n)
Nonegear(): //空档处理
wh i l e(!back—gear&&forward—gear
&&none—gear&&manual—auto&&key—on)
Backward(): //倒档处理
i f(back—gear+none—gear+forward—gear<2)
ERR—analysiS(SHIFT—HANDLE—ERROR);
if(I key—on&&!fire)park()://停车
delay(100):
goto 1abel:
' EnableXInterrupt:
While(1)
if (Egine_running ) THEN
power_on_flag=O
i f(power_on_f l ag=O)
END IF
SUB Ainitialize()
if 1 THEN
engine_running
Clutch_off(Empty_Rate)
Gear Case Reset()
END IF
engine_running=1
power_on_flag=l
''''''''''''''''''''''''''''''''''''''''''''就这样改的 都差不多的 不知道你的原来的程序有没错啊
el se power—on—flag=l:
EnableInterruptS;
delay(5000):
for(::)
{read一165():
if(manual auto==AUTO)
{
Gun—peda l—track():
wh i 1 e(f forward—gear&&none—gear
&&back—gear&&manual—auto&&key—on)
Forward(): //前进档处理
whi 1 e(!none—gear&&forward~gear
&&back—gear&&manual—auto&&key一0n)
Nonegear(): //空档处理
wh i l e(!back—gear&&forward—gear
&&none—gear&&manual—auto&&key—on)
Backward(): //倒档处理
i f(back—gear+none—gear+forward—gear<2)
ERR—analysiS(SHIFT—HANDLE—ERROR);
if(I key—on&&!fire)park()://停车
delay(100):
goto 1abel:
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询