Encoder acting as 2 buttons
To interface to a 3-terminal scrollwheel you'll need to implement some type of state machine (either in hardware or in software).  Here's how these devices are wired:



The S pin is typically connected to VCC and the A and E pins (both with pull-downs to ground) are the two outputs; the opposite wiring (with S tied to ground and pull-ups on A and E) is also possible.  The outputs are fed into the state machine for decoding.  As the dial is turned the change in the A and E signals indicates the direction of rotation.  As can be seen in the state diagram below, the switches turn on and off with a 50% duty cycle and the two switches are 90° out of phase with one-another.  The transition from one state to another has only a single bit change (i.e. the values are Gray coded).



Put into tabular form we get:


 +-----+----+----+----+--------------------+
 | Previous | Current |                    |
 |   E | A  |  E | A  | Direction          |
 +-----+----+----+----+--------------------+
 |   1 | 0  |  1 | 1  | Clockwise          |
 |   1 | 1  |  0 | 1  | Clockwise          |
 |   0 | 1  |  0 | 0  | Clockwise          |
 |   0 | 0  |  1 | 0  | Clockwise          |
 +-----+----+----+----+--------------------+
 |   1 | 0  |  0 | 0  | Counter-clockwise  |
 |   0 | 0  |  0 | 1  | Counter-clockwise  |
 |   0 | 1  |  1 | 1  | Counter-clockwise  |
 |   1 | 1  |  1 | 0  | Counter-clockwise  |
 +-----+----+----+----+--------------------+


So you'll need to keep track of the state of the two outputs.  Whenever either of the outputs changes you can compare the current state to the previous state to determine which way the dial was turned.

Here's a full diagram of the required interface circuitry.  You'll need to take the Signal A and Signal E outputs and feed them in to whatever state machine you implement.



The Bit Generator is the scroll wheel.  The upper 10kΩ resistors are pull-ups to have the outputs default to 1.  When the switches are on they pull the output signal down to 0.  The lower pair of 10kΩ resistors along with the two 0.01µF capacitors are used to debounce the output.

As described in this answer, a suitable state machine for your application could be constructed from two 74-series ICs (a 7400 and a 7474):



State machine circuit image adapted from original by EM Fields; other images adapted from this datasheet.