Line Tracking Sensor

Image.png
Image.png
COMPONENTS:
-Arduino Uno
-KY-033 Line Tracing Sensor
-Buzzer

CODE:
int buzzer = 13;
int Sensor = A0;
int sensorValue = 0;
void setup () {
  pinMode (buzzer, OUTPUT);
  Serial.begin (9600);
}
void loop () {
  sensorValue = analogRead (Sensor);
  if (sensorValue < 50&& sensorValue < 500)
  {
  digitalWrite (buzzer, HIGH);
  Serial.println (sensorValue, DEC);
  }
  else (sensorValue > 500&& sensorValue > 1023);
  {
  digitalWrite (buzzer, LOW);
  Serial.println (sensorValue, DEC);
  }
}