Hi,
Threading or multiprocessing may not be necessary at all. You could just check the serial port once every screen refresh, which might be rapid enough for you. i.e. just incorporate port reading into your standard drawing loop.
I imagine you are just checking the scanner's serial output in the same way one checks for key presses, and the drawing loop frequency is generally fine for that.
Would this work for you?
Regards,
Mike
On 15/07/2014, at 3:28 a.m., Aaron Lee <
ach....@gmail.com> wrote:
> I'm currently developing a program for an experiment that requires constant reading from a serial port while the experiment is presenting some stimuli and audio cues in order to track activity from an fMRI. Does anyone have any experience with this. The only way I can think of doing this would be to have 2 separate python script running in parallel using threading or multiprocessing but I'm not sure if this will cause any significant timing issues.
>
>
--
Michael R. MacAskill, PhD 66 Stewart St
Research Director, Christchurch 8011
New Zealand Brain Research Institute NEW ZEALAND
Research Fellow,
michael....@nzbri.org
Te Whare Wānanga o Otāgo, Otautahi Ph:
+64 3 3786 072
University of Otago, Christchurch
http://www.nzbri.org/macaskill