Go to most recent revision | Blame | Last modification | View Log | Download
unit Blikac;
interface
uses PortInc,Windows, Messages, SysUtils, Classes,
Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
ScrollBar1: TScrollBar; Edit1: TEdit;
Timer1: TTimer;
ScrollBar2: TScrollBar;
Edit2: TEdit;
StaticText1: TStaticText;
StaticText2: TStaticText;
CheckBox1: TCheckBox;
procedure ScrollBar1Change(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure ScrollBar2Change(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
var Vystup: Integer;
procedure TForm1.ScrollBar1Change(Sender: TObject);
begin
Edit1.Text := floattostr(Scrollbar1.Position)+ ' us';
end;
procedure TForm1.ScrollBar2Change(Sender: TObject);
begin
Edit2.Text := floattostr(Scrollbar2.Position)+ ' us';
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
OpenCom (Pchar('COM1:9600,N,8,1'));
//!!!!
Timer1.Enabled := true;
Vystup := 0;
Timer1.Interval := 1000;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var n: integer;
begin
for n:=1 to 5000000 div(Scrollbar1.Position+Scrollbar2.Position) do
begin
DTR (1);
// RTS (1);
// delayus(Scrollbar1.Position);
DTR (0);
// RTS (0);
// delayus(Scrollbar2.Position);
end;
DTR (0);
RTS (0);
end;
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
if CheckBox1.Checked then DTR (1) else DTR(0);
end;
end.