Hi Katya
your map statement is the problem - if you pass the map function an integer it will return an integer (so either 0,1 or 2 in your case rather than a float between 0.5 and 2.0).
if you change the map statement to -
float pitch = map((float)pitchValue, 0, 1023, 0.5, 2.0); // Map the...