PDA

View Full Version : basic flasher


coppo
06 Feb 06, 11:23 AM
a very basic flasher setup...using the repeat function.



[initialisation ]
disableModule("flash");
SetLightingLevel("Bedside 1", 0%, "0s");
SetLightingLevel("Bedside 2", 0%, "0s");


[run module]
{ there are various other ways this example could be structured }

{ turns on the "flash" module }
once (GetLightingState("TEST GA") = ON) then
begin
EnableModule("flash");
end;

{ turns off the "flash" module }
once (GetLightingState("TEST GA") = OFF) then
begin
disableModule("flash");
end;

{ Resets the "flash" module group addresses once the module is turned off,
how useful this code is depends on the "delay" time values used in "flash " module }

once (GetLightingState("TEST GA") = OFF) then
begin
SetLightingLevel("Bedside 1", 0%, "0s");
SetLightingLevel("Bedside 2", 0%, "0s");
end;


[Flash module]
repeat
SetLightingLevel("Bedside 1", 80%, "0s");
Delay(1); { 1 second delay }
SetLightingLevel("Bedside 1", 0%, "0s");
Delay(2); { 2 second delay }
SetLightingLevel("Bedside 2", 80%, "0s");
Delay(1); { 1 second delay }
SetLightingLevel("Bedside 2", 0%, "0s");
Delay(2); { 2 second delay }
until (GetLightingState("TEST GA")= OFF);