I am new to working with Phidgets and with Python so this question may be very basic. I am attempting to write a program which takes voltage ratio info from 5 sensors (one for each finger) and uses this to control the position of a shape presented on screen using Psychopy.
I have a working code (see below), but it seems to be very slow and inefficient as I only see the cursors move ~2x per second. The code below is executed every frame. It takes the new voltage ratio, subtracts that from the baseline voltage ratio, and then uses this to calculate the new position variable. The position of the shape is then also updated each frame (code not shown here).
Code: Select all
Is there a better way to do this? I thought perhaps to use an event handler might be better, but I have struggled to use the event handler function to create a variable which I can then use outside the function. Also I should mention slow frame rate does not seem to be an inherent problem of the monitor, I can present other things at much higher time resolution.
Thanks in advance!