Doubt Regarding Encoder

I changed arduino uno to arduino mega