int16_tpulses_per_revolution=24;// Depends on encoder model. Usually 18ppr or 24ppr for Bourns EC11s.
int16_tfull_joystick_value=32767;// Equivalent to max value of int16. +full_joystick_value is +1.0 axis output. -full_joystick_value is -1.0 axis output.
joystick_position+=(clockwise?2:-2)*(full_joystick_value/pulses_per_revolution);// +2 and -2 are used, since +1.0 and -1.0 axis output refers to positions at half of a full rotation