Skip to content

Instantly share code, notes, and snippets.

@futureshocked
Created January 6, 2020 04:59
Show Gist options
  • Save futureshocked/1780c5ff1e9bafece817b422a9ebe08c to your computer and use it in GitHub Desktop.
Save futureshocked/1780c5ff1e9bafece817b422a9ebe08c to your computer and use it in GitHub Desktop.
This sketch implements a simple line sensor for the Arduino
// Line Sensor Breakout - Analog
int out;
void setup()
{
Serial.begin(9600); // sets the serial port to 9600
}
void loop()
{
out = analogRead(0); // read analog input pin 0
Serial.println(out, DEC); // print the value of the sensor
delay(100); // wait 100ms for next reading
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment