stepper not moving

i used one code the stepper moved
i used another peice of code with the same code the stepper dosent move
please help

code 1 ( the one that works )

int Pin1 = 3; 
int Pin2 = 4; 
int Pin3 = 5; 
int Pin4 = 9; 
int _step = 0; 
boolean dir = true;// false=clockwise, true=counter clockwise
int count=0;
void setup() 
{ 
 pinMode(Pin1, OUTPUT);  
 pinMode(Pin2, OUTPUT);  
 pinMode(Pin3, OUTPUT);  
 pinMode(Pin4, OUTPUT);  
} 
 void loop() 
{ 
 switch(_step){ 
   case 0: 
     digitalWrite(Pin1, LOW);  
     digitalWrite(Pin2, LOW); 
     digitalWrite(Pin3, LOW); 
     digitalWrite(Pin4, HIGH); 
   break;  
   case 1: 
     digitalWrite(Pin1, LOW);  
     digitalWrite(Pin2, LOW); 
     digitalWrite(Pin3, HIGH); 
     digitalWrite(Pin4, HIGH); 
   break;  
   case 2: 
     digitalWrite(Pin1, LOW);  
     digitalWrite(Pin2, LOW); 
     digitalWrite(Pin3, HIGH); 
     digitalWrite(Pin4, LOW); 
   break;  
   case 3: 
     digitalWrite(Pin1, LOW);  
     digitalWrite(Pin2, HIGH); 
     digitalWrite(Pin3, HIGH); 
     digitalWrite(Pin4, LOW); 
   break;  
   case 4: 
     digitalWrite(Pin1, LOW);  
     digitalWrite(Pin2, HIGH); 
     digitalWrite(Pin3, LOW); 
     digitalWrite(Pin4, LOW); 
   break;  
   case 5: 
     digitalWrite(Pin1, HIGH);  
     digitalWrite(Pin2, HIGH); 
     digitalWrite(Pin3, LOW); 
     digitalWrite(Pin4, LOW); 
   break;  
     case 6: 
     digitalWrite(Pin1, HIGH);  
     digitalWrite(Pin2, LOW); 
     digitalWrite(Pin3, LOW); 
     digitalWrite(Pin4, LOW); 
   break;  
   case 7: 
     digitalWrite(Pin1, HIGH);  
     digitalWrite(Pin2, LOW); 
     digitalWrite(Pin3, LOW); 
     digitalWrite(Pin4, HIGH); 
   break;  
   default: 
     digitalWrite(Pin1, LOW);  
     digitalWrite(Pin2, LOW); 
     digitalWrite(Pin3, LOW); 
     digitalWrite(Pin4, LOW); 
   break;  
 } 
 if(dir){ 
   _step++; 
 }else{ 
   _step--; 
 } 
 if(_step>7){ 
   _step=0; 
 } 
 if(_step<0){ 
   _step=7; 
 } 
 delay(1); 

}

code 2 ( the one that dosent work )

  const int AOUTpin=0;//the AOUT pin of the CO sensor goes into analog pin A0 of the arduino
const int DOUTpin=8;//the DOUT pin of the CO sensor goes into digital pin D7 of the arduino
const int ledPin=12;//the anode of the LED connects to digital pin D13 of the arduino

int limit;
int value;

const int LED = 13;
const int BUTTON = 7;

int val = 0;
int old_val = 0;
int state = 0;
int h;
int t;

 #include "DHT.h"

   DHT DHT_sens(8, DHT11);           

int Pin1 = 3; 
int Pin2 = 4; 
int Pin3 = 5; 
int Pin4 = 9; 
int _step = 0; 
boolean dir = true;
int count=0;

void setup()
{
  Serial.begin(9600);//sets the baud rate
   pinMode(Pin1, OUTPUT);  
 pinMode(Pin2, OUTPUT);  
 pinMode(Pin3, OUTPUT);  
 pinMode(Pin4, OUTPUT);  
    pinMode(LED,OUTPUT);
pinMode(BUTTON, INPUT);

pinMode(DOUTpin, INPUT);//sets the pin as an input to the arduino
pinMode(ledPin, OUTPUT);//sets the pin as an output of the arduino

   DHT_sens.begin();

   Serial.begin (9600);
   Serial.println ("===============================================");
   Serial.println (" AUTO-SAFE ");
   Serial.println ("===============================================");
   }
void loop(){
val = digitalRead(BUTTON);

if( val == HIGH && old_val == LOW) {
state = 1-state;
delay (10);
}

old_val = val;

if ( state == 1)
digitalWrite(LED,HIGH);
else
digitalWrite(LED, LOW);
 {if ( state == 1)
  Serial.print("ALARM AKNOWLEGED       ");
  else
  Serial.print("ALARM UN ACKNOWLEGED       ");
 }
value = analogRead(AOUTpin);//reads the analaog value from the CO sensor's AOUT pin
limit = digitalRead(DOUTpin);//reads the digital value from the CO sensor's DOUT pin
Serial.print("CO: ");
Serial.println(value);//prints the CO value
Serial.println("=============================");


if (value > 750) digitalWrite(ledPin, HIGH);

if (value < 750) digitalWrite(ledPin, LOW);




   
h = DHT_sens.readHumidity();
   t = DHT_sens.readTemperature();


   delay (1000);                       
   Serial.print ("Humidity:");
   Serial.print (h,0);    
   // zero decimal
   Serial.print (" %\t");
   Serial.print ("Temparature: ");
   Serial.print (t,1);                  
   Serial.println (" *C");
   if (h > 50) digitalWrite(ledPin, HIGH);  
Serial.print("ahhhhhh");
 
 switch(_step){ 
   case 0: 
     digitalWrite(Pin1, LOW);  
     digitalWrite(Pin2, LOW); 
     digitalWrite(Pin3, LOW); 
     digitalWrite(Pin4, HIGH); 
   break;  
   case 1: 
     digitalWrite(Pin1, LOW);  
     digitalWrite(Pin2, LOW); 
     digitalWrite(Pin3, HIGH); 
     digitalWrite(Pin4, HIGH); 
   break;  
   case 2: 
     digitalWrite(Pin1, LOW);  
     digitalWrite(Pin2, LOW); 
     digitalWrite(Pin3, HIGH); 
     digitalWrite(Pin4, LOW); 
   break;  
   case 3: 
     digitalWrite(Pin1, LOW);  
     digitalWrite(Pin2, HIGH); 
     digitalWrite(Pin3, HIGH); 
     digitalWrite(Pin4, LOW); 
   break;  
   case 4: 
     digitalWrite(Pin1, LOW);  
     digitalWrite(Pin2, HIGH); 
     digitalWrite(Pin3, LOW); 
     digitalWrite(Pin4, LOW); 
   break;  
   case 5: 
     digitalWrite(Pin1, HIGH);  
     digitalWrite(Pin2, HIGH); 
     digitalWrite(Pin3, LOW); 
     digitalWrite(Pin4, LOW); 
   break;  
     case 6: 
     digitalWrite(Pin1, HIGH);  
     digitalWrite(Pin2, LOW); 
     digitalWrite(Pin3, LOW); 
     digitalWrite(Pin4, LOW); 
   break;  
   case 7: 
     digitalWrite(Pin1, HIGH);  
     digitalWrite(Pin2, LOW); 
     digitalWrite(Pin3, LOW); 
     digitalWrite(Pin4, HIGH); 
   break;  
   default: 
     digitalWrite(Pin1, LOW);  
     digitalWrite(Pin2, LOW); 
     digitalWrite(Pin3, LOW); 
     digitalWrite(Pin4, LOW); 
   break;  
 } 
 if(dir){ 
   _step++; 
 }else{ 
   _step--; 
 } 
 if(_step>7){ 
   _step=0; 
 } 
 if(_step<0){ 
   _step=7; 
 } 
 delay(1); 
}

please help
please im dying here
thanks you in adance :confused: :confused: :confused: :confused: :confused:

please ignore my scream in the code
sorry

Is your dying scream printed?