Rotary Encoder as a switch

I would like to use a rotary encoder (AS5040) as a switch. For example, when spinning, the arduino would pin 2 HIGH at 90 degrees, then LOW at 95d, then pin 4 HIGH at 105d and LOW at 110d etc..I'm using it to commutate a pulse motor. I'm hoping to use it in quadrature if it works.

Help greatly appreciated.

First step. Write some code to read the encoder and increment/decrement a variable depending on the direction that it is turning. Then you can tackle the problem of taking action at certain angles.

Google or a search in this forum will find you examples of how to read the encoder.