SparkFun Forums 

Where electronics enthusiasts find answers.

User avatar
By DanV
#201767
In the datasheet:
https://files.valinonline.com/userfiles ... sensor.pdf
the word "teach" is not found. Not sure why you would ask about it.
But, generally, a photosensor teach mode requires you to place an object in the sensing area, push a button, then remove and press again.

If you get one of these, you may want one with the suffix "-P" for PNP type that sources voltage to your input rather than pulling your input low.
Also, that particular unit is de-rated based on the target size, smaller target, smaller sensing range.
\Were you planning on the broad face of the hockey stick being detected or the edge?
You may even find a distributor that can demo the unit for you.