LED time on duration #170
Unanswered
FlaviaRicciardi
asked this question in
Q&A
Replies: 1 comment 2 replies
-
|
Hi @FlaviaRicciardi, If I understand correctly, you'd like an LED to turn on at the start of the session, then turn off after a few seconds. you'll need to
something like this: events =["startup_LED_expired"]
v.startup_LED_duration = 5 * second
def run_start():
hw.LED.on()
set_timer('startup_LED_expired', v.startup_LED_duration)
def all_states(event):
if event == "startup_LED_expired":
hw.LED.off()Let us know if that works, or if I misunderstood your question. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I wrote a task that starts with:
def run_start():
hw.LED.on()
hw.oephys_TRG.on()
hw.mic_TRG.on()
set_timer('session_timer', v.session_duration)
def run_end():
hw.off()
def init_trial(event):
if event == 'entry':
hw.LED.off()
v.trial_number += 1
print('Trial number: {}'.format(v.trial_number))
timed_goto_state('reward_delivery', v.delay_to_reward[v.delay_index])
v.delay_index += 1
elif event == 'external_poke_IN':
v.external_poke += 1
goto_state('reward_delivery')
I put hw.LED.on() in the first def because in this way, I can synch the start of the pycontrol task with the video (I can see that LED in the video). But, in this way the LED is on for very few seconds and it is not so easy to see it in the camera. Do you have any advise on how can I make the LED ON more visible when the task tarts?
Thank you very much in advance
Beta Was this translation helpful? Give feedback.
All reactions