srbox inline script
Hi! I'd like to use an srbox in an inline script.
However, if I use the code from here https://osdoc.cogsci.nl/3.3/manual/response/srbox/#function-srbox__init__experiment-devnone in this way:
import srbox srbox.__init__(experiment, dev = COM1) t0 = clock.time() srbox.start() button, t1 = srbox.get_button_press(allowed_buttons=[1,2], require_state_change=True) if button == 1: response_time = t1 - t0 print('Button 1 was pressed in %d ms!' % response_time) srbox.stop()
I get the following error:
name 'experiment' is not defined.
If I delete the line:
srbox.__init__(experiment, dev = COM1)
then I get the following error:
'module' object has no attribute 'start'.
I would appreciate any help to solve this issue. Note that this is a very "plain" experiment aimed to do nothing more than get the srbox to work.