Proximity sensor

Long live arduino
Please help me i am new to arduino, please set code for proximity sensor, if i want to control 5 pneumatic cylinder, vacuum gripper, stepper motor nema 23 with tb6600 driver,12v dc gear motor,electromagnet and inductive proximity sensor with arduino.
1 pneumatic cylinder = c1
2 pneumatic cylinder = c2
3 pneumatic cylinder =c3
4 pneumatic cylinder =c4
5 pneumatic cylinder =c5
6 vacuum =v
7stepper motor with tb6600 driver with 3 pin =
stepPin,dirPin,enPin
8 gear motor =GM
9 electromagnet =EM
10 proximity sensor =PS
Please help me when proximity sensor is “on” only
Gear motor (GM) should work in reverse and all other functions should stop and againafter short delay all functions should be activated and so on.
NOTE :PROXIMITY SENSOR WILL ACTIVE AFTER 15MIN UPTO 15 MIN GEAR MOTOR IS GOING IN FORWARD DIRECTION

incomplete_without_proximity_sensor.ino (1.48 KB)

Long live arduino
Please help me i am new to arduino, please set code for proximity sensor, if i want to control 5 pneumatic cylinder, vacuum gripper, stepper motor nema 23 with tb6600 driver,12v dc gear motor,electromagnet and inductive proximity sensor with arduino.
1 pneumatic cylinder = c1
2 pneumatic cylinder = c2
3 pneumatic cylinder =c3
4 pneumatic cylinder =c4
5 pneumatic cylinder =c5
6 vacuum =v
7stepper motor with tb6600 driver with 3 pin =
stepPin,dirPin,enPin
8 gear motor =GM
9 electromagnet =EM
10 proximity sensor =PS
Please help me when proximity sensor is “on” only
Gear motor (GM) should work in reverse and all other functions should stop and againafter short delay all functions should be activated and so on.
NOTE :PROXIMITY SENSOR WILL ACTIVE AFTER 15MIN UPTO 15 MIN GEAR MOTOR IS GOING IN FORWARD DIRECTION
Int c1 = 2;
Int v = 3;
Int GM = 4;
Int stepPin = 5;
Int dirPin = 6;
Int enPin = 7;
Int c2 = 8;
Int c3 = 9;
Int c4 = 10;
Int c5= 11;
Int EM = 12;

void setup () {
pinMode(c1,OUTPUT);
pinMode(v,OUTPUT);
pinMode(GM,OUTPUT);
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
pinMode(enPin,OUTPUT);
pinMode(c2,OUTPUT);
pinMode(c3,OUTPUT);
pinMode(c4,OUTPUT);
pinMode(c5,OUTPUT);
pinMode(EM,OUTPUT);
digitalWrite(enPin,LOW);
}
void loop () {
digitalWrite(c1,HIGH);
delay(100);
digitalWrite(v,HIGH);
delay(100);
digitalWrite(c1,LOW);
delay(100);
digitalWrite(GM,HIGH);
delay(100);
digitalWrite(GM,LOW);
delay(50);
digitalWrite(dirPin,HIGH);
for(int x =0;x<800;x++){
digitalWrite(stepPin,HIGH);
delayMicrosecond(500);
digitalWrite(stepPin,LOW);
delayMicrosecond(500);
}
digitalWrite(c1,HIGH);
delay(100);
digitalWrite(v,LOW);
delay(100);
digitalWrite(c1,LOW);
delay(100);
digitalWrite(c2,HIGH);
delay(100);
digitalWrite(c2,LOW);//no delay
digitalWrite(c3,HIGH);
delay(100);
digitalWrite(c3,LOW);
delayMicrosecond(500);
digitalWrite(dirPin,LOW);
for(int x=0;x<800;x++){
digitalWrite(stepPin,HIGH);
delayMicrosecond(500);
digitalWrite(stepPin,LOW);
delayMicrosecond(500);
}
digitalWrite(c4,HIGH);
delay(100);
digitalWrite(c5,HIGH);
delay(100);
digitalWrite(EM,HIGH);
delay(100);
digitalWrite(c5,LOW);
delay(100);
digitalWrite(c4,LOW);
delay(100);
digitalWrite(EM,LOW);
}

incomplete_without_proximity_sensor.ino (1.48 KB)

Please atych the code You mabe made so faar.

Duplicate, reported.

@Sha0321

Please DO NOT cross post as it wastes peoples time and effort.
Topics MERGED.

Bob.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html .
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :slight_smile:

Please keep the communication here, in this topic. Personal messages will not be answered.