lights not turning off when given command

MEDState Notation Repository Forums Coding Help Archive lights not turning off when given command

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

    Hi, been working on this program lately, the problem lies in state sets 5 and 7, when the button is pressed, the response is recorded and the the program appropriately proceeds to deliver a reward or initiate a timeout period, however the cue lights fail to turn off. Please let me know if you can at all help Thanks

    \This is a visual discrimination task
    \animals will simultaneously be presented with 2 cues, one a steady light, the other blinking
    \animals will only be rewarded for pressing during the blinking cue.
    \pressing during the steady cue will initiate a 15 second timeout cue
    \ correct responses to a blinking cue will be scored as hits
    \responses to a steady cue will be scored as misses
    
    \constants
    ^house=7
    ^sweet=3
    ^LeftLight=4
    ^RightLight=6
    
     
    
    \z pulses
    \z1 dispense reward
    \z2 max trails reached, ends program
    \z5 cue selection(blinking or steady)
    \z7 iti bin
    \z8 right blinking light
    \z9 left blinking light
    \z12 timeout phase
    
    \variables
    \q=time marker to record latencies
    \y=side selection
    \b=blink counter1
    \d=blink counter2
    \u=timeout counter
    \s= trial counter
    
     
    
    \arrays
    \C= iti length = 9+-3
    \E=iti/ trial
    \F=Hits
    \G=Hit Latencies
    \H=Misses
    \I=Miss Latencies
    \j=cue selection
    \o=omissions
    printvars=s,q,c,d,f,g,h,i,j,o
    diskvars=s,q,c,d,f,g,h,i,j,o
    
    list c=6",7",8",9",10",11",12"
    list j=1,2
    
    dim e=120
    dim f=120
    dim g=120
    dim h=120
    dim i=120
    dim o=120
    
    s.s.1,
    s1,
    #start: on ^house; --->s2
    
    s2,
    #z2: print--->stopabortflush
    
     
    
     
    
     
    
    s.s.2,\ iti 9+-3"
    s1,
    .01":randi x=c;add s;if s> 120 [@end, @cont]
    @end:z2--->sx
    @cont: --->s2
    
     
    
    s2,
    x#T:z5;set e(s)=x--->s3
    
    s3,
    #z7:--->s1
    
     
    
     
    
     
    
    s.s.3 , \random light selection
    s1,
    #z5 :randi y=j--->s2
    
     
    
    s2,
    .01": if y=1[@blinkright, @blinkleft]
    @blinkright:z8--->s1
    @blinkleft:z9--->s1
    
    s.s.4, \blink right
    s1,
    #z8:--->s2
    
     
    
    s2,
    .01":on ^RightLight; on ^LeftLight--->s3
    
    s3,
    .5":off ^RightLight; add b--->s4
    
    s4,
    .5": if b=10[@true, @false]
    @true:set b=0;off ^LeftLight--->s1
    @false:--->s2
    
    s.s.5, \ look for response
    s1,
    #z8:set q=btime--->s2
    
    s2,
    #r2: z1;z7;add F(s);set G(s)=(btime-q);off ^RightLight; off ^LeftLight--->s1
    #r1: z12;add H(s);set I(s)=(btime-q);off ^RightLight; off^LeftLight--->s1
    7":z7;add o(s)--->s1
    
     
    
     
    
    s.s.6, \blink left
    s1,
    #z9:--->s2
    
    s2,
    .01":on ^LeftLight;on ^RightLight--->s3
    
    s3,
    .5":off ^LeftLight; add d--->s4
    
    s4,
    .5": if d=10[@true, @false]
    @true:set d=0;off ^RightLight--->s1
    @false:--->s2
    
    s.s.7, \look for response
    s1,
    #z9:--->s2
    
    s2,
    
    #r1: z1;z7;add F(s);set G(s)=(btime-q);off ^RightLight; off ^LeftLight --->s1
    #r2: z12;add H(s);setI(s)=(btime-q);off ^RightLight; off ^LeftLight--->s1
    7":z7;add o(s)--->s1
    
     
    
     
    
    s.s.8, \timeout phase
    
    s1,
    #z12:off ^house;set u=0--->s2
    s2,
    1":add u--->s3
    s3,
    .01": if u =15[@true, @false]
    @true:on ^house;z7--->s1
    @false:--->s2
    
    s.s.9 \rewards
    s1,
    #z1:set a=0;on ^sweet--->s2
    s2,
    1": add a--->s3
    s3,
    .025":if a =6[@true, @false]
    @true: off ^sweet--->s1
    @false:--->s2
    


    never mind I figured it out

    #13140
    Med_Support
    Moderator
    Gary Bamberger

    I’m glad that you were able to figure it out on your own. You actually learn a lot more that way.

    Gary

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.