Flicker module

This software module

  1) Triggers the next FLICKER

  2) Receives input to become activated by the previous FLICKER or the Force Start Button

  3) Controls the Active LEDs (the ultra bright white LEDs in the floor and ceiling)

  4) Controls the Fail LEDs (red LEDs in the floor and ceiling)

 

Public Functions:

initFlicker

  Turn off white LEDs in ceiling and floor

  Turn off red LEDs in ceiling and floor

  Update all timing variables with the current time

  Read the initial value of the FLICKER start input

 

checkFlickerEvents

  If enough time has passed for debouncing the force start button

    Read the input start command

    Return this value

  Else

    Return the last input start command

 

startNextFlicker

  Set output HI

  Wait 75 [ms]

  Set output LO

 

turnOnActive(turnOnLEDs)

  If (turnOnLEDs)

    Turn white LEDs on

  Else

    Turn white LEDs off

 

blinkActive(timeToWait)

  If more than timeToWait [ms] have passed

    If white LEDs are currently off

       Turn them on

    Else

       Turn them off

 

turnOnFail(turnOnLEDs)

  If (turnOnLEDs)

    Turn red LEDs on

  Else

    Turn red LEDs off

 

blinkFail(timeToWait)

  If more than timeToWait [ms] have passed

    If red LEDs are currently off

       Turn them on

    Else

       Turn them off

 

Module Functions:

wait(wait_time)

  Wait until the current time minus the start time is greater than the wait time