Doubt Regarding Encoder

I have connected r1= 47ohms r2= 68ohms ... i have trouble in sketch code