demo code for Rotary Angle Sensor