I am doing some robotic control and I am using a quadrature encoder with digital channels A and B. I would like to implement an interrupt every time CHA raises. When CHA raises, check the state of CHB. If channel B is high or low, increment or decrement when necessary.
My code is below, can any possible help me understand why it isn't working. The monitor just shows 0, 0, 0, 0, ... etc.
Your problem is in that attach statement, you don't put a pin number there you put a 0 if wired to pin 2 or 1 if wired to pin 3, those are the only two user interrupt options for a 328p based board.