I recently started using PsychoPy (on Ubuntu 18.04) and have some trouble getting access to the parallel port. I try to use the parallel functions to read data from a button box. I have a built-in parallel port and its address is /dev/parport0.
This is what I am trying to do:
#!/usr/bin/env python # -*- coding: utf-8 -*- from psychopy import parallel, core p = parallel.ParallelPort(address = '/dev/parport0') timer = core.CountdownTimer(5) while timer.getTime() > 0: input = p.readData() if (input)>0: print(input)
I don’t get any error messages, it just receives only zeros in variable input.
Before I had some issues opening the port but as I am now in the lp group which can access the parallel ports without root, I have no more error messages. But still I cannot detect anything. The button boxes are working, as I can detect the presses in Presentation using Windows.
I have tried PsychoPy versions 2.8 and 3.0 - no difference.
Maybe there is something obvious I am missing? Or has anyone some experience with accessing parallel ports?
I would be so glad!
Thank you in advance!