     } else {
       buttonPressed = false;
     }
+  }
   
+  if (currentState == 0) {
+    reading = digitalRead(BLACK_READ_PIN);  
+    if(reading == HIGH){
+      stopMovement();
+    } else {
+      moveForward();
+    }
+    delay(500);
   }
 }
+
+void stopMovement(){
+  servoLeft.writeMicroseconds(1500);
+  servoRight.writeMicroseconds(1500);
+}


const int buttonPin = 8;     // the number of the pushbutton pin
const int numberOfStates = 3;


// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status
int currentState = numberOfStates - 1;
bool buttonPressed;

void setup() {
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);

  Serial.begin(9600);
  


void loop() {
  // read the state of the pushbutton value:
  buttonState = digitalRead(BUTTON_PIN);

  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
