print(Channel)
print(type(Channel))
As the function works when you hard code it with an integer 1
, what is the chance that your variable is somehow made up of strings?
Your code is fighting against itself: if the time of EventOffset
has passed, so has the time of EventOnset
, so both signals will be sent on every screen refresh once the EventOffset
time has elapsed.
You should probably maintain some flags like onset_signal_sent
and offset_signal_sent
that are initialised to False
at the start of the trial, and then used to decide whether to send their respective signals (only i.e. send the signal if the time has elapsed and the value is False
, and then set them to be True
, so the sending happens only once).
Also: