basic flasher

Discussion in 'Pascal Logic Code Examples' started by coppo, Feb 6, 2006.

  1. coppo

    coppo

    Joined:
    Sep 7, 2004
    Messages:
    221
    Likes Received:
    10
    Location:
    Adelaide
    a very basic flasher setup...using the repeat function.

    Code:
    
    [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);
    
    
     

    Attached Files:

    coppo, Feb 6, 2006
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.