You've already forked lazarus-ccr
56 lines
866 B
ObjectPascal
56 lines
866 B
ObjectPascal
![]() |
unit Main;
|
||
|
|
||
|
{$mode objfpc}{$H+}
|
||
|
|
||
|
interface
|
||
|
|
||
|
uses
|
||
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
|
||
|
AdvLed;
|
||
|
|
||
|
type
|
||
|
|
||
|
{ TForm1 }
|
||
|
|
||
|
TForm1 = class(TForm)
|
||
|
AdvLed1: TAdvLed;
|
||
|
Button1: TButton;
|
||
|
RadioGroup1: TRadioGroup;
|
||
|
procedure Button1Click(Sender: TObject);
|
||
|
procedure RadioGroup1Click(Sender: TObject);
|
||
|
private
|
||
|
|
||
|
public
|
||
|
|
||
|
end;
|
||
|
|
||
|
var
|
||
|
Form1: TForm1;
|
||
|
|
||
|
implementation
|
||
|
|
||
|
{$R *.lfm}
|
||
|
|
||
|
{ TForm1 }
|
||
|
|
||
|
procedure TForm1.Button1Click(Sender: TObject);
|
||
|
begin
|
||
|
AdvLed1.Flash(100);
|
||
|
end;
|
||
|
|
||
|
procedure TForm1.RadioGroup1Click(Sender: TObject);
|
||
|
begin
|
||
|
AdvLed1.BlinkDuration := 500;
|
||
|
AdvLed1.Blink := false;
|
||
|
case RadioGroup1.ItemIndex of
|
||
|
0: AdvLed1.State := lsDisabled;
|
||
|
1: AdvLed1.State := lsOFF;
|
||
|
2: AdvLed1.State := lsON;
|
||
|
3: AdvLed1.Blink := true;
|
||
|
end;
|
||
|
Button1.Enabled := RadioGroup1.ItemIndex > 0;
|
||
|
end;
|
||
|
|
||
|
end.
|
||
|
|