unit PPDHn;
interface
uses
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
Button9: TButton;
Button10: TButton;
Button11: TButton;
Timer1: TTimer;
Timer2: TTimer;
Timer3: TTimer;
Button12: TButton;
Button13: TButton;
Button14: TButton;
Shape1: TShape;
Shape2: TShape;
Shape3: TShape;
Shape4: TShape;
Shape5: TShape;
Shape6: TShape;
Shape7: TShape;
Shape8: TShape;
private
public
{ Public declarations }
end;
var
implementation
{$R *.dfm}
procedure delay(lama:longint);
var ref:longint;
begin
ref:=gettickcount;
repeat application.processmessages;
until ((gettickcount-ref)>=lama);
end;
begin
if lampuke = 0 then
begin
shape1.Brush.Color := clWhite;
shape2.Brush.Color := clWhite;
shape3.Brush.Color := clWhite;
shape4.Brush.Color := clWhite;
shape5.Brush.Color := clWhite;
shape6.Brush.Color := clWhite;
shape7.Brush.Color := clWhite;
shape8.Brush.Color := clWhite;
end else
if lampuke = 1 then
begin
shape1.Brush.Color := clGreen;
shape2.Brush.Color := clWhite;
shape3.Brush.Color := clWhite;
shape4.Brush.Color := clWhite;
shape5.Brush.Color := clWhite;
shape6.Brush.Color := clWhite;
shape7.Brush.Color := clWhite;
shape8.Brush.Color := clWhite;
end else
if lampuke = 2 then
begin
shape1.Brush.Color := clWhite;
shape2.Brush.Color := clGreen;
shape3.Brush.Color := clWhite;
shape4.Brush.Color := clWhite;
shape5.Brush.Color := clWhite;
shape6.Brush.Color := clWhite;
shape7.Brush.Color := clWhite;
shape8.Brush.Color := clWhite;
end else
if lampuke = 4 then
begin
shape1.Brush.Color := clWhite;
shape2.Brush.Color := clWhite;
shape3.Brush.Color := clGreen;
shape4.Brush.Color := clWhite;
shape5.Brush.Color := clWhite;
shape6.Brush.Color := clWhite;
shape7.Brush.Color := clWhite;
shape8.Brush.Color := clWhite;
end else
if lampuke = 8 then
begin
shape1.Brush.Color := clWhite;
shape2.Brush.Color := clWhite;
shape3.Brush.Color := clWhite;
shape4.Brush.Color := clGreen;
shape5.Brush.Color := clWhite;
shape6.Brush.Color := clWhite;
shape7.Brush.Color := clWhite;
shape8.Brush.Color := clWhite;
end else
if lampuke = 16 then
begin
shape1.Brush.Color := clWhite;
shape2.Brush.Color := clWhite;
shape3.Brush.Color := clWhite;
shape4.Brush.Color := clWhite;
shape5.Brush.Color := clGreen;
shape6.Brush.Color := clWhite;
shape7.Brush.Color := clWhite;
shape8.Brush.Color := clWhite;
end else
if lampuke = 32 then
begin
shape1.Brush.Color := clWhite;
shape2.Brush.Color := clWhite;
shape3.Brush.Color := clWhite;
shape4.Brush.Color := clWhite;
shape5.Brush.Color := clWhite;
shape6.Brush.Color := clGreen;
shape7.Brush.Color := clWhite;
shape8.Brush.Color := clWhite;
end else
if lampuke = 64then
begin
shape1.Brush.Color := clWhite;
shape2.Brush.Color := clWhite;
shape3.Brush.Color := clWhite;
shape4.Brush.Color := clWhite;
shape5.Brush.Color := clWhite;
shape6.Brush.Color := clWhite;
shape7.Brush.Color := clGreen;
shape8.Brush.Color := clWhite;
end else
begin
shape1.Brush.Color := clWhite;
shape2.Brush.Color := clWhite;
shape3.Brush.Color := clWhite;
shape4.Brush.Color := clWhite;
shape5.Brush.Color := clWhite;
shape6.Brush.Color := clWhite;
shape7.Brush.Color := clWhite;
shape8.Brush.Color := clGreen;
END ELSE
begin
shape1.Brush.Color := clGreen;
shape2.Brush.Color := clGreen;
shape3.Brush.Color := clGreen;
shape4.Brush.Color := clGreen;
shape5.Brush.Color := clGreen;
shape6.Brush.Color := clGreen;
shape7.Brush.Color := clGreen;
shape8.Brush.Color := clGreen;
END;
end;
begin
Portout (888,128);
urutanLampu (128);
end;
begin
Portout (888,64);
urutanLampu (64);
end;
begin
Portout (888,32);
urutanLampu (32);
end;
begin
Portout (888,16);
urutanLampu (16);
end;
Portout (888,8);
urutanLampu (8);
end;
begin
Portout (888,4);
urutanLampu (4);
end;
begin
Portout (888,2);
urutanLampu (2);
end;
begin
Portout (888,1);
urutanLampu (1);
end;
begin
begin
Button9.Caption := 'Out';
timer1.Enabled:= true;
end else
begin
Button9.Caption := 'Go';
timer1.Enabled:= false;
Portout (888,0);
shape1.Brush.Color := clWhite;
shape2.Brush.Color := clWhite;
shape3.Brush.Color := clWhite;
shape4.Brush.Color := clWhite;
shape5.Brush.Color := clWhite;
shape6.Brush.Color := clWhite;
shape7.Brush.Color := clWhite;
shape8.Brush.Color := clWhite;
end;
end;
begin
begin
shape1.Brush.Color := clGreen;
shape2.Brush.Color := clWhite;
shape3.Brush.Color := clGreen;
shape4.Brush.Color := clWhite;
shape5.Brush.Color := clGreen;
shape6.Brush.Color := clWhite;
shape7.Brush.Color := clGreen;
shape8.Brush.Color := clWhite;
portout(888,85);
delay(1000);
end else
begin
shape1.Brush.Color := clWhite;
shape2.Brush.Color := clGreen;
shape3.Brush.Color := clWhite;
shape4.Brush.Color := clGreen;
shape5.Brush.Color := clWhite;
shape6.Brush.Color := clGreen;
shape7.Brush.Color := clWhite;
shape8.Brush.Color := clGreen;
portout(888,170);
delay(1000);
end;
end;
begin
Close;
end;
begin
PortOut(888, 255);
urutanLampu(255);
end;
begin
PortOut(888, 0);
urutanLampu(0);
end;
begin
begin
Button11.Caption := 'Out';
timer3.Enabled:= true;
end else
begin
Button11.Caption := 'Go';
timer3.Enabled:= false;
Portout (888,0);
shape1.Brush.Color := clGreen;
shape2.Brush.Color := clGreen;
shape3.Brush.Color := clGreen;
shape4.Brush.Color := clGreen;
shape5.Brush.Color := clGreen;
shape6.Brush.Color := clGreen;
shape7.Brush.Color := clGreen;
shape8.Brush.Color := clGreen;
end;
end;
begin
begin
shape1.Brush.Color := clGreen;
shape2.Brush.Color := clGreen;
shape3.Brush.Color := clwhite;
shape4.Brush.Color := clwhite;
shape5.Brush.Color := clGreen;
shape6.Brush.Color := clGreen;
shape7.Brush.Color := clwhite;
shape8.Brush.Color := clWhite;
portout(888,51);
delay(100);
end else
begin
shape1.Brush.Color := clWhite;
shape2.Brush.Color := clWhite;
shape3.Brush.Color := clwhite;
shape4.Brush.Color := clwhite;
shape5.Brush.Color := clGreen;
shape6.Brush.Color := clGreen;
shape7.Brush.Color := clGreen;
shape8.Brush.Color := clGreen;
portout(888,240);
delay(100);
begin
shape1.Brush.Color := clGreen;
shape2.Brush.Color := clGreen;
shape3.Brush.Color := clGreen;
shape4.Brush.Color := clGreen;
shape5.Brush.Color := clWhite;
shape6.Brush.Color := clwhite;
shape7.Brush.Color := clwhite;
shape8.Brush.Color := clWhite;
portout(888,15);
delay(100);
begin
shape1.Brush.Color := clwhite;
shape2.Brush.Color := clwhite;
shape3.Brush.Color := clwhite;
shape4.Brush.Color := clwhite;
shape5.Brush.Color := clwhite;
shape6.Brush.Color := clWhite;
shape7.Brush.Color := clWhite;
shape8.Brush.Color := clwhite;
portout(888,0);
delay(100) ;
end;
end;
end;
end;
begin
begin
Button10.Caption := 'Out';
timer2.Enabled:= true;
end else
begin
Button10.Caption := 'Go';
timer2.Enabled:= false;
Portout (888,0);
shape1.Brush.Color := clWhite;
shape2.Brush.Color := clWhite;
shape3.Brush.Color := clWhite;
shape4.Brush.Color := clWhite;
shape5.Brush.Color := clWhite;
shape6.Brush.Color := clWhite;
shape7.Brush.Color := clWhite;
shape8.Brush.Color := clWhite;
end;
end;
begin
begin
shape1.Brush.Color := clwhite;
shape2.Brush.Color := clWhite;
shape3.Brush.Color := clWhite;
shape4.Brush.Color := clGreen;
shape5.Brush.Color := clGreen;
shape6.Brush.Color := clWhite;
shape7.Brush.Color := clWhite;
shape8.Brush.Color := clwhite;
portout(888,24);
delay(100);
end else
begin
shape1.Brush.Color := clWhite;
shape2.Brush.Color := clwhite;
shape3.Brush.Color := clGreen;
shape4.Brush.Color := clWhite;
shape5.Brush.Color := clWhite;
shape6.Brush.Color := clGreen;
shape7.Brush.Color := clwhite;
shape8.Brush.Color := clWhite;
portout(888,36);
delay(100);
begin
shape1.Brush.Color := clWhite;
shape2.Brush.Color := clGreen;
shape3.Brush.Color := clwhite;
shape4.Brush.Color := clWhite;
shape5.Brush.Color := clWhite;
shape6.Brush.Color := clwhite;
shape7.Brush.Color := clGreen;
shape8.Brush.Color := clWhite;
portout(888,66);
delay(100);
begin
shape1.Brush.Color := clGreen;
shape2.Brush.Color := clWhite;
shape3.Brush.Color := clWhite;
shape4.Brush.Color := clwhite;
shape5.Brush.Color := clwhite;
shape6.Brush.Color := clWhite;
shape7.Brush.Color := clWhite;
shape8.Brush.Color := clGreen;
portout(888,129);
delay(100) ;
begin
shape1.Brush.Color := clGreen;
shape2.Brush.Color := clGreen;
shape3.Brush.Color := clGreen;
shape4.Brush.Color := clGreen;
shape5.Brush.Color := clGreen;
shape6.Brush.Color := clGreen;
shape7.Brush.Color := clGreen;
shape8.Brush.Color := clGreen;
portout(888,255);
delay(100) ;
end;
end;
end;
end;
end;
end.