Need help controlling 2 motors with tsl2561 and tcs3200 to stop motor

I couldn't resolve the issue but thanks anyway!

[Solved]

Did you successfully run the examples coming with the TLS library?

I wonder why you need a color sensor, and where it is placed.

Can't you just have the Arduino remember which curtain is shown? As long as you know where you are and where you want to go, direction is trivial. No sensors needed.

How are 2 motors and 3(?) curtains related?

I still don't understand your controller. Does the sensor measure the inside color, and the controller adjusts the colored curtains so that a given color is maintained?

So you need two more sensors for each curtain, telling whether it's fully expanded or retracted. Depending on the lux reading show or retract the curtains, until the sensors tell the right position is reached.

How will you know when a curtain is fully expanded or retracted?

I still think that we are talking about different things :frowning:

If you think that you can determine the state of the curtains from the color sensor, you should verify that yourself. Draw the curtains manually back and forth, and check the related sensor values.

I don't know what the sensor could or should detect, and consequently cannot tell what should happen then :frowning: