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);
  }
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s