Infrared Distance Sensor

Liam Brady

Infrared distance sensors are sensors that measure how far away an object is by shooting infrared light at the object and measuring how much light is reflected back. They output an analog current which can be read by the Arduino.

void setup() {
  Serial.begin(9600);
}

void loop() {
  int val = analogRead(A0);

  Serial.println(val);

  delay(100);
}