mt_ozer
Üye
- Katılım
- 12 Nis 2017
- Mesajlar
- 14
- Puanları
- 1
- Yaş
- 43
Şu kodları çalıştırmak istiyorum. Simulasyon da gördüğüm sadece ilk çalıştıgında bütün pinler çalışıyor ancak sonra sadece en son satırdaki pinler çalışıyor. Nasıl bir hata var burada.
Asıl yapmaya çalıştığım şu;
"Selenoidpin" devreye girsin
Pin5 açsın
1sn sonra Pin2 açsın ardından
pin5 kapattı
pin kapandı Pin1 açtı.
pin2 kapandı. Pin3 açtı.
tekrar pin2 açtı kapanıp pin3 açtı.
pin4 bağimsız olarak sürekli açıp kapanacak şekilde.
Bu konuda çok acemiyim ama senaryo bu.
int solenoidPin = 11; //This is the output pin on the Arduino
void setup()
{
pinMode(solenoidPin, OUTPUT); //Sets that pin as an output
}
void loop()
{
digitalWrite(solenoidPin, HIGH); //Switch Solenoid ON
delay(1000); //Wait 1 Second
digitalWrite(solenoidPin, LOW); //Switch Solenoid OFF
delay(1000); //Wait 2 Second
}
int solenoidPin1 = 12; //This is the output pin on the Arduino
void setup()
{
pinMode(solenoidPin1, OUTPUT); //Sets that pin as an output
}
void loop()
{
digitalWrite(solenoidPin1, HIGH); //Switch Solenoid ON
delay(1000); //Wait 1 Second
digitalWrite(solenoidPin1, LOW); //Switch Solenoid OFF
delay(1000); //Wait 2 Second
}
int solenoidPin2 = 8; //This is the output pin on the Arduino
void setup()
{
pinMode(solenoidPin2, OUTPUT); //Sets that pin as an output
}
void loop()
{
digitalWrite(solenoidPin2, HIGH); //Switch Solenoid ON
delay(1000); //Wait 1 Second
digitalWrite(solenoidPin2, LOW); //Switch Solenoid OFF
delay(1000); //Wait 2 Second
}
int solenoidPin3 = 9; //This is the output pin on the Arduino
void setup()
{
pinMode(solenoidPin3, OUTPUT); //Sets that pin as an output
}
void loop()
{
digitalWrite(solenoidPin3, HIGH); //Switch Solenoid ON
delay(1000); //Wait 1 Second
digitalWrite(solenoidPin3, LOW); //Switch Solenoid OFF
delay(1000); //Wait 2 Second
}
int solenoidPin4 = 6; //This is the output pin on the Arduino
void setup()
{
pinMode(solenoidPin4 OUTPUT); //Sets that pin as an output
}
void loop()
{
digitalWrite(solenoidPin4, HIGH); //Switch Solenoid ON
delay(1000); //Wait 1 Second
digitalWrite(solenoidPin4, LOW); //Switch Solenoid OFF
delay(1000); //Wait 2 Second
}
int solenoidPin5 = 4; //This is the output pin on the Arduino
void setup()
{
pinMode(solenoidPin5, OUTPUT); //Sets that pin as an output
}
void loop()
{
digitalWrite(solenoidPin5, HIGH); //Switch Solenoid ON
delay(1000); //Wait 1 Second
digitalWrite(solenoidPin5, LOW); //Switch Solenoid OFF
delay(1000); //Wait 2 Second
}
Asıl yapmaya çalıştığım şu;
"Selenoidpin" devreye girsin
Pin5 açsın
1sn sonra Pin2 açsın ardından
pin5 kapattı
pin kapandı Pin1 açtı.
pin2 kapandı. Pin3 açtı.
tekrar pin2 açtı kapanıp pin3 açtı.
pin4 bağimsız olarak sürekli açıp kapanacak şekilde.
Bu konuda çok acemiyim ama senaryo bu.
int solenoidPin = 11; //This is the output pin on the Arduino
void setup()
{
pinMode(solenoidPin, OUTPUT); //Sets that pin as an output
}
void loop()
{
digitalWrite(solenoidPin, HIGH); //Switch Solenoid ON
delay(1000); //Wait 1 Second
digitalWrite(solenoidPin, LOW); //Switch Solenoid OFF
delay(1000); //Wait 2 Second
}
int solenoidPin1 = 12; //This is the output pin on the Arduino
void setup()
{
pinMode(solenoidPin1, OUTPUT); //Sets that pin as an output
}
void loop()
{
digitalWrite(solenoidPin1, HIGH); //Switch Solenoid ON
delay(1000); //Wait 1 Second
digitalWrite(solenoidPin1, LOW); //Switch Solenoid OFF
delay(1000); //Wait 2 Second
}
int solenoidPin2 = 8; //This is the output pin on the Arduino
void setup()
{
pinMode(solenoidPin2, OUTPUT); //Sets that pin as an output
}
void loop()
{
digitalWrite(solenoidPin2, HIGH); //Switch Solenoid ON
delay(1000); //Wait 1 Second
digitalWrite(solenoidPin2, LOW); //Switch Solenoid OFF
delay(1000); //Wait 2 Second
}
int solenoidPin3 = 9; //This is the output pin on the Arduino
void setup()
{
pinMode(solenoidPin3, OUTPUT); //Sets that pin as an output
}
void loop()
{
digitalWrite(solenoidPin3, HIGH); //Switch Solenoid ON
delay(1000); //Wait 1 Second
digitalWrite(solenoidPin3, LOW); //Switch Solenoid OFF
delay(1000); //Wait 2 Second
}
int solenoidPin4 = 6; //This is the output pin on the Arduino
void setup()
{
pinMode(solenoidPin4 OUTPUT); //Sets that pin as an output
}
void loop()
{
digitalWrite(solenoidPin4, HIGH); //Switch Solenoid ON
delay(1000); //Wait 1 Second
digitalWrite(solenoidPin4, LOW); //Switch Solenoid OFF
delay(1000); //Wait 2 Second
}
int solenoidPin5 = 4; //This is the output pin on the Arduino
void setup()
{
pinMode(solenoidPin5, OUTPUT); //Sets that pin as an output
}
void loop()
{
digitalWrite(solenoidPin5, HIGH); //Switch Solenoid ON
delay(1000); //Wait 1 Second
digitalWrite(solenoidPin5, LOW); //Switch Solenoid OFF
delay(1000); //Wait 2 Second
}