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
newRthumb= voltageRatioRthumb.getVoltageRatio()
newRindex= voltageRatioRindex.getVoltageRatio()
newRmiddle= voltageRatioRmiddle.getVoltageRatio()
newRring= voltageRatioRring.getVoltageRatio()
newRlittle= voltageRatioRlittle.getVoltageRatio()
BLedRthumb=newRthumb-BLRthumb
BLedRindex=newRindex-BLRindex
BLedRmiddle=newRmiddle-BLRmiddle
BLedRring=newRring-BLRring
BLedRlittle=newRlittle-BLRlittle
PosRthumb =(BLedRthumb/0.000125)-0.75
PosRindex =(BLedRindex/0.000125)-0.75
PosRmiddle =(BLedRmiddle/0.000125)-0.75
PosRring =(BLedRring/0.000125)-0.75
PosRlittle =(BLedRlittle/0.000125)-0.75
Thanks in advance!