Professional Documents
Culture Documents
SC - Mando CASE721B
SC - Mando CASE721B
Program Mando;
Const
F_FIRST = 28;
F_SECOND = 24;
F_THIRD = 8;
F_QUIRT = 1;
NEUTER = 0;
R_FIRST = 22;
R_SECOND = 18;
R_THIRD = 2;
Var
Forward: Boolean absolute P1.0;
Reverse: Boolean absolute P1.1;
INC: Boolean absolute P1.2;
DEC: Boolean absolute P1.3;
S_ENABLE: Boolean absolute P2.0;
R_ENABLE: Boolean absolute P2.1;
Gear: Integer;
auxGear: Integer;
Inf: Boolean;
PUSH: Boolean;
INTRO: Boolean;
//asim: array[0..15] of char;
Begin
P3:= 0;
Inf:= False;
P0:= 0;
Gear:= 0;
P1.4:= False;
P1.5:= False;
P1.6:= False;
P1.7:= False;
P2.0:= True;
P2.1:= False;
P2.2:= False;
P2.3:= False;
P2.4:= False;
P2.5:= False;
P2.6:= False;
P2.7:= False;
// S_ENABLE:= False;
// R_ENABLE:= False;
Repeat
P3:= Gear;
P2:= auxGear;
Gear:= Gear + 1;
DelayTime(50,50,10);
Until Gear > 4;
Gear:= 0;
P3:= Gear;
Repeat
If not Forward Then
Begin
If Gear = 0 then Gear:=1;
If (auxGear > -3 ) and (auxGear < 0) Then Gear := auxGear * (-1);
S_ENABLE:= True;
R_ENABLE:= False;
If not INC Then
If Gear < 4 Then
Begin
Gear:= Gear + 1;
INTRO:= True;
DelayTime(50,50,10);
end;
Case Gear of
-1: P0:= R_FIRST;
0: P0:= NEUTER;
1: P0:= F_FIRST;
2: P0:= F_SECOND;
3: P0:= F_THIRD;
4: P0:= F_QUIRT;
end;