ouptocoupler device with arduino programming

i had some trouble about programming with arduino an i can't understand.
i have some device :

ouptocoupler sensor, driver motor device and motor DC

how the programming sample if want to control the ouptocoupler sensor with arduino programming to do something :

  1. move with determined count flip flop, (i markers mounted on a ouptocoupler (i attached Acrylic on a circle of black and white to calculate high and low, if i Used oscillator and rotating the sensor through the optocoupler there will appear to pulse box)).
    thank you if you reply my post

Are you asking about an "optical encoder"?