How to program a Controller for curtains?

Hi,

Im a beginner, and I want to build a controller for my curtains, regulated by a light sensor.

I managed to get the motor spinning if the sensor sends "0" and turn on an LED if its sending an "1". Now can I get the motor to turn the other way if its needed and use several if conditions which just switch on, if the one before has run a specific command. Like only after turning once for 5 sec (the other option is "do nothing!"), continue to the next if condition and if it has not turned, repeat the first command until it has.

Looking forward for help.
Thanks.

A state machine may be what you need.

Try to do it, when you get stuck ask for help. Show us your best effort and explain what you are having difficulty with.

Don’t forget code tags for your code.

Thanks.

Okay thanks

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.