I used the Builder to build my experiment, and I wanted to add some changes with the Coder.
Each trial consists of this, in seconds:
- 0->6 : nothing
- 6->7 : image presentation
- 7->13 : nothing
- 13->17 : rating scale
During those 12 seconds of “nothing”, I want to insert a few code lines to connect to an Arduino board and record some data (heart beats). Basically, the Arduino code is a 6 second loop that checks for incoming data from the USB port. The heartbeats will then be saved for each trial with addData:
The problem is, to control for timing, Psychopy seems to be tracking each frame, and adding my 6 second loop seems to mess up the times.
I thought the Static Screen might be good for this, but when I add a 6 second Static Screen with some code, I cannot find that code in the file when I compile and search the file.
I also thought about using the Code Component, but it applies to either the start of the routine or the end, but I also need my code in between (seconds 7 to 13).
Perhaps you can recommend a way of achieving this?
Thank you very much,