Danny van den Brande
Published © CC BY-SA

Arduino - Detecting a White Line With The KY-033

Hello world! I made a simple example on the KY-033 Line Tracing module. In the video i Detect a white line.

BeginnerProtip1 hour3,808
Arduino - Detecting a White Line With The KY-033

Things used in this project

Story

Read more

Schematics

Schematic

Code

KY-033_LINE_TRACING_Module.ino

Arduino
in this example i show you how to use the KY-033 as a white line tracer.
/*
Author: Danny van den Brande, Arduinosensors.nl. Bluecore Tech
in this example i show you how to use the KY-033 as a white line tracer.
 */
int WhiteLed = 2; 
int Sensor = A5; 
int sensorValue = 0; 

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

Credits

Danny van den Brande

Danny van den Brande

36 projects • 72 followers
"Hello world."

Comments