Flashing cue lights

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13245
    Med_Support
    Moderator
    ScoresOfMice

    Does anyone know a way to make the stimulus lights blink other than turning them on, then off, then on, etc?

    I would like to be able to easily change the duration and frequency of the blinking (ie sometimes use 2Hz, 5 seconds, sometimes use 5 Hz, 3 seconds, etc.) without rewriting the program every time.

     

    Thanks.

    #13246
    Med_Support
    Moderator

    Try this:

    Var_Alias Time ON  = A(0)  \ Default = 1 second
    Var_Alias Time OFF = A(1)  \ Default = 1 second
    Var_Alias Duration = A(2)  \ Default = 5 seconds
    
     
    
    DIM A = 2
    DIM B = 2
    
     
    
    S.S.5,
    S1,
    0.001": SET A(0) = 1, A(1) = 1, A(2) = 5 ---> S2
    
    S2,   \ 1st Statement: Convert the Time to MED Ticks.
    \
    \ 2nd Statement: Update display with current Blink Rate
    \ and Duration.
    #START: SET B(0) = A(0) * 1", B(1) = A(1) * 1", B(2) = A(2) * 1" ---> S3
    0.01": SHOW 1,Time ON,A(0), 2,Time OFF,A(1), 3,Duration,A(2) ---> S2
    
    S3,
    B(1)#T: ON 1 ---> S4
    #Z1: ---> S2
    
    S4,
    B(0)#T: OFF 1 ---> S3
    #Z1: OFF 1 ---> S2
    
     
    
    S.S.6,
    S1,
    #START: ---> S2
    
    S2,   \ Time the Duration
    B(2)#T: Z1 ---> S1
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.