I recently bought an analog IR line sensor from Sparkfun http://www.sparkfun.com/products/9453. I didn't really have a plan for it but now I'd like to try making a wheel encoder for a robot. I printed out an alternating black/white encoder pattern and attached it to one of the robot wheels. The sensor picks up the difference in colors which is good. However, to use this to actually count every pulse I need to use the attachInterrup() function. Problem is, that only works on the interrupt pins which are digital.
So I have an analog sensor returning values on the analog pins of ~40 for black and >200 for white. What I need is to convert that signal to HIGH or LOW for digital pin 2. Sounds like I need some external components to force these signals all the way HIGH or LOW so the digital state will change. Of course the other alternative is to buy a digital output IR sensor but I'm hoping I can get something working with the parts I have.
Any thoughts would be appreciated!