Help for count an optocuplor on arduino

Hi again to all.
This is ok right now.I see on serial 0 and 1.
Now I want to do a track with a slot to see if it can read engine speed but first i'll put on the machine holes.
Many many thanks.