Subversion Repositories svnkaklik

Rev

Go to most recent revision | Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
unit Blikac;
2
 
3
interface
4
 
5
uses PortInc,Windows, Messages, SysUtils, Classes,
6
  Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls;
7
 
8
type
9
  TForm1 = class(TForm)
10
    ScrollBar1: TScrollBar; Edit1: TEdit;
11
    Timer1: TTimer;
12
    procedure ScrollBar1Change(Sender: TObject);
13
    procedure FormCreate(Sender: TObject);
14
    procedure Timer1Timer(Sender: TObject);
15
  end;
16
 
17
var
18
  Form1: TForm1;
19
 
20
implementation
21
{$R *.DFM}
22
var Vystup: Integer;
23
 
24
procedure TForm1.ScrollBar1Change(Sender: TObject);
25
begin
26
  Edit1.Text := floattostr(Scrollbar1.Position)+ ' ms';
27
  Timer1.Interval := Scrollbar1.Position
28
end;
29
 
30
procedure TForm1.FormCreate(Sender: TObject);
31
begin
32
  OpenCom (Pchar('COM2:9600,N,8,1'));
33
  Timer1.Enabled := true;
34
  Vystup := 0;
35
end;
36
 
37
procedure TForm1.Timer1Timer(Sender: TObject);
38
begin
39
  Vystup := (Vystup + 1) AND 1;
40
  DTR (Vystup);
41
  RTS (Vystup);
42
end;
43
 
44
end.