The code is very simple. In the setup() method I detect the "zero" position of the potentiometer. After the word "start" written by the user the acquisition starts. Before real acquisition the Arduino detects the initial time that must be subtracted to the actual one to find the angular speed by the divisione space/time