Changing sample frequency of acquisition
Posted: Mon Nov 18, 2019 9:53 am
Hi,
Maybe stupid question (hope someone did not answer in the topic, I did not find it...).
I am using the python code automatically generated for the PhidgetBridge 4-Input.
I would like to set the sample frequency of the acquisition. I thought it was the 5000 but it is not (btw I do not understand what this 5000 do, when I changed it I do not see any change).
Does someone know how to change the sample frequency ? Is there a method of the Phidget22 library that I need to use ?
Thank you
Maybe stupid question (hope someone did not answer in the topic, I did not find it...).
I am using the python code automatically generated for the PhidgetBridge 4-Input.
Code: Select all
from Phidget22.Phidget import *
from Phidget22.Devices.VoltageRatioInput import *
import time
def onVoltageRatioChange(self, voltageRatio):
print("VoltageRatio [" + str(self.getChannel()) + "]: " + str(voltageRatio))
def main():
voltageRatioInput0 = VoltageRatioInput()
voltageRatioInput1 = VoltageRatioInput()
voltageRatioInput2 = VoltageRatioInput()
voltageRatioInput3 = VoltageRatioInput()
voltageRatioInput0.setChannel(0)
voltageRatioInput1.setChannel(1)
voltageRatioInput2.setChannel(2)
voltageRatioInput3.setChannel(3)
voltageRatioInput0.setOnVoltageRatioChangeHandler(onVoltageRatioChange)
voltageRatioInput1.setOnVoltageRatioChangeHandler(onVoltageRatioChange)
voltageRatioInput2.setOnVoltageRatioChangeHandler(onVoltageRatioChange)
voltageRatioInput3.setOnVoltageRatioChangeHandler(onVoltageRatioChange)
voltageRatioInput0.openWaitForAttachment(5000)
voltageRatioInput1.openWaitForAttachment(5000)
voltageRatioInput2.openWaitForAttachment(5000)
voltageRatioInput3.openWaitForAttachment(5000)
try:
input("Press Enter to Stop\n")
except (Exception, KeyboardInterrupt):
pass
voltageRatioInput0.close()
voltageRatioInput1.close()
voltageRatioInput2.close()
voltageRatioInput3.close()
main()
Does someone know how to change the sample frequency ? Is there a method of the Phidget22 library that I need to use ?
Thank you