2 sensors for a motor controller

I need a little help.
The purpose of this device is to distribute the sheet, one after one.

I want a motor controller with 2 sensors (CNY70)
the sensor 1 starts the motor only when you go LOW to HIGH, but it ignores the reverse.
and
the sensor 2 stops the motor only when you go HIGH to LOW, but it ignores the reverse

I can not write a code that starts an action in one case but ignores the other case

can not write a code that starts an action in one case but ignores the other case

Why ? (or why not?)