- Home /
Pen Input Sampling Frequency
Hello! I am trying to develop a tool to record handwriting data using a pen tablet connected to my computer.
I know how to give visual feedback and get position and pressure data BUT I need a constant sampling frequency of (at least) 100 Hz (my pen actually can send data at 133 Hz).
I used fixedupdate to get data and write them in an outputf file every 0.01 seconds BUT there are many sequential copies of sample, looking like the fixedaupdate is going faster than the polling frequency of the input, so it records the same data for many instants because unity didn't actually updated the input yet (this last is my hypothesis).
So, my actual sampling frequency is lower than 100 Hz (deleting the copies it is approximately about 60 Hz).
I found out that I can change the polling frequency with the following code:
void start () { InputSystem.pollingFrequency = 100; }
but It does not affect any change on the outcome.
Does anyone of you know how to actually control the input sampling frequency or to call the data writing process in an other event that is synchronized with the input pen?
EDIT: I significantly reduced the problem calling the function "InputSystem.Update();" before writing data and setting "manually" in project settings > input system package > update mode. But still have some artifacts. Help :(
Your answer
Follow this Question
Related Questions
Input not writed into log file with same frequency. 0 Answers
Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers
Microsoft Surface Pen working in editor, but not build 2 Answers
How to integrate Windows.UI.Input.Inking.dll used for pen input with Microsoft Surface Pro? 0 Answers
How to let Unity recognize Saumsung S-pen input as Touch input rather than Mouse Click 1 Answer