Daftar Pustaka
Supriyadi, Moh. 2005. Pemrograman Sistem Pengendali dengan Delphi. Yogyakarta : C.V.
Andi Offset.
Supardi Yuniar. 2004, Borland Delphi dalam praktek, Datakom lintas Buana. Jogiyanto. 2001, Analisis dan Desain Sistem Informasi : C.V. Andi Offset Tavri D Mahyuzir. 1995, Analisa dan perancangan sistem pengolahan data,Elex media komputindo Depdikbud. 1998, Kamus Bahasa Indonesia, Balai Pustaka Jakarta Taufik, Adi. 2003. Mengakses port parallel PC (LPT) dengan Delphi 7.0. Diambil dari : www. ilmukomputer.com. (12 agustus 2010) Widodo Budhi Romy dan Dedy Joseph. 2007. Interfacing serial dan port Pararel dengan Delphi : C.V. Andi Offset. Irma, 2008. Flowchart, diambil dari : www.Irma.Blogspot.com (30 januari 2011)
TAMPILAN HARDWARE
Gambar L1. Sensor infrared Receiver
Gambar L2. Sensor Infrared Transmiter
Gambar L3. Pengujian sensor dengan kertas
Gambar L4. Pengujian sensor dengan kayu
Gambar L5. Pengujian sensor dengan tangan manusia
LAMPIRAN
LISTING PROGRAM unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Menus, ComCtrls, StdCtrls, ExtCtrls, DB, DBTables, DBCtrls, Grids, DBGrids, TeeProcs, TeEngine, Chart, DbChart, Series, RpCon, RpConDS, RpDefine, RpRave, RpRender, RpRenderCanvas, RpRenderPrinter; type TForm1 = class(TForm) MainMenu1: TMainMenu; File1: TMenuItem; Exit1: TMenuItem; StatusBar1: TStatusBar; GroupBox1: TGroupBox; Shape1: TShape; Button1: TButton; Label1: TLabel; indTmr: TTimer; DataSource1: TDataSource; Table1: TTable; DBChart1: TDBChart; DBChart2: TDBChart; DBGrid1: TDBGrid; DBNavigator1: TDBNavigator; Series1: TLineSeries; Series2: TBarSeries; Table1Tanggal: TDateField; Table1Bayak_pengunjung: TIntegerField; Table2: TTable; Table2Tanggal: TDateField; Table2Waktu: TTimeField; Table2Kuantitas: TIntegerField; Timer1: TTimer; RvProject1: TRvProject; RvDataSetConnection1: TRvDataSetConnection; LAPORAN1: TMenuItem; procedure Exit1Click(Sender: TObject); procedure Button1Click(Sender: TObject); procedure indTmrTimer(Sender: TObject); procedure Ab1Click(Sender: TObject); procedure Timer1Timer(Sender: TObject);
procedure LAPORAN1Click(Sender: TObject); private { Private declarations } public var_global:byte; count:integer; function bacaport:byte; procedure addData(kuantitas:integer); procedure addx(banyak:integer); //procedure log(pesan:string); { Public declarations } end; var Form1: TForm1; implementation function PortIn(Port:Word):Byte;stdcall;external'io.dll'; procedure PortOut(Port:Word;Data:Byte); stdcall; external'io.dll'; {$R *.dfm} procedure TForm1.Exit1Click(Sender: TObject); begin //Exit Aplikasi; Application.Terminate; end; procedure TForm1.Button1Click(Sender: TObject); begin //Start function if Button1.Caption='Start' then begin //aktifkan tmrwatch indTmr.Enabled:=true; //aktifkan tmrdata Timer1.Enabled:=True; //tmrData.Enabled:=true; Button1.Caption:='Stop'; end else begin //aktifkan tmrwatch indTmr.Enabled:=False; Timer1.Enabled:=False; Button1.Caption:='Start'; shape1.Brush.color:=clred; addx(count); end;
end; procedure TForm1.addData(kuantitas: integer); begin //ubah mode table1 menjadi mode insert Table2.Insert; Table2Tanggal.AsDateTime:=now; Table2Waktu.AsDateTime:=now; Table2Kuantitas.AsInteger:=Kuantitas; //simpan data yang di masukan Table2.Post; //refresh data pada DBchart1 DBChart1.RefreshData; end; procedure TForm1.indTmrTimer(Sender: TObject); var data:byte; begin //indikator sensor cek data:=bacaport and $01; //if shape1.Brush.color=clred then shape1.Brush.color:= cllime else shape1.Brush.color:=clred; if data = $00 then shape1.Brush.color:= cllime; if data<> var_global then begin var_global:=data; if var_global=$00 then begin inc(count); //shape1.Brush.color:= cllime; //log(inttostr(count)); end end; end; procedure TForm1.Ab1Click(Sender: TObject); begin //About Form end; //Fungsi Baca Port Parallel function TForm1.bacaport:byte; var input1,data:integer; begin input1:= PortIn($379) xor $80; input1:= (input1 shr 3) and $01; data:= input1; result:= data; end;
procedure TForm1.Timer1Timer(Sender: TObject); begin //df addData(count); end;
procedure TForm1.addx(banyak: integer); begin Table1.Insert; Table1Tanggal.AsDateTime:=now; Table1Bayak_pengunjung.asInteger:=banyak; //simpan data yang di masukan Table1.Post; //refresh data pada DBchart1 DBChart1.RefreshData; end;
procedure TForm1.LAPORAN1Click(Sender: TObject); begin RvProject1.Execute; RvProject1.ExecuteReport('report.rav'); end;
end.