Help with Leonardo & Rotary Optical Encoder

mrburnette:
Personally, I think using 2 digital pins would be more appropriate:

For example D3 and D4,
D3 = 0, D4 = 0 case 1
D3 = 1, D4 = 0 case 2
D3 = 0, D4 = 1 case 3
D3 = 1, D4 = 1 case 4

Now just put switch case in loop() and add your specific coded between the cases and common code before/after the case.

I would rather use the 4 individual inputs and just ground them. I have plenty of I/O and it simplifies the type of rotary switch I need to get. Can you give me examples of the code? This is my hangup right now. If all I needed to do was output the left and right arrow keyboard presses I would be done, but I need to use the same manual pulse generator/Leonardo to output 3 more pair of characters depending on which of the inputs are asserted to ground. I've spent hours on this project today and am happy to have gotten were I am, but now frustrated I can't find sample code similar to what I need to finish up. So close.... :slight_smile:

Thanks!
Marty