Conveyor Traffic Help

Hi eveyone how are you.

Can you help me how i wrote a code for my conveyor traffic. It's seem easy but i don't know ardunio language very well.

First of all i have 4 E18-d80nk sensor, and three conveyor "Angle conveyor - Straight Conveyor - Feeding Conveyor"

Location of sensor; Sensor1 on the Angle Conveyor, Sensor2 and Sensor3 on the Straight Conveyor, Sensor4 on the Feeding Conveyor.

Emergency stop bottun my only option give conveyors start and stop command.

So thats the logic i want to write on ardunio;

Until sensor1 see an object more than 1,5 second this conveyor must keep working (reason reach the object to top of the conveyor) else stop conveyor but its the tricky part coming. If Sensor2 and Sensor3 both of them or one of them seen an object ( no time limit those two) angle conveyor must stop, if is not object any of them Angle conveyor must keep running. (reason this action, object transfer to angle conveyor to straight conveyor but make sure no another object waiting on the straight conveyor)

The second part of logic is simple guess. Sensor5 on the feeding conveyor, if sensor5 seen object more than 1.5 seconds Straight conveyor must be stop, else working.

Sorry about my english, its not my first language.

Thank you for your helps.

kadircakir:
Can you help me how i wrote a code for my conveyor traffic. It's seem easy but i don't know ardunio language very well.

Don't start with writing code - which on the Arduino IDE is C++. Start with a flowchart or a state diagram to get clear in your head what the program must do in any instance. Make a drawing roughly laying out the locations of conveyors, sensors, motors, switches, etc. Post the drawing here so the folks at home can play along.

Work through the sketches in IDE/file/examples/digital to learn how to use the building blocks you need to do basic things.

And, as always there's: How to use this forum.