Blame | Last modification | View Log | Download
unit Blikac;interfaceuses PortInc,Windows, Messages, SysUtils, Classes,Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls;typeTForm1 = 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;varForm1: TForm1;implementation{$R *.DFM}var Vystup: Integer;procedure TForm1.ScrollBar1Change(Sender: TObject);beginEdit1.Text := floattostr(Scrollbar1.Position)+ ' us';end;procedure TForm1.ScrollBar2Change(Sender: TObject);beginEdit2.Text := floattostr(Scrollbar2.Position)+ ' us';end;procedure TForm1.FormCreate(Sender: TObject);beginOpenCom (Pchar('COM1:9600,N,8,1'));//!!!!Timer1.Enabled := true;Vystup := 0;Timer1.Interval := 1000;end;procedure TForm1.Timer1Timer(Sender: TObject);var n: integer;beginfor n:=1 to 5000000 div(Scrollbar1.Position+Scrollbar2.Position) dobeginDTR (1);// RTS (1);// delayus(Scrollbar1.Position);DTR (0);// RTS (0);// delayus(Scrollbar2.Position);end;DTR (0);RTS (0);end;procedure TForm1.CheckBox1Click(Sender: TObject);beginif CheckBox1.Checked then DTR (1) else DTR(0);end;end.