Reads position from optical sensor correctly. Use interrupt.