/* This code is for connecting TS-290 Infrared Proximity Sensor to Arduino Analog Pin 0 http://tinkersphere.com/sensors/290--infrared-proximity-sensor-short-range-with-jst-connector-sharp-gp2y0a41sk0f.html Connection: Sensor Wires --> Arduino Pin Yellow --> Arduino A0 Red --> Arduino 5V Black --> Arduino GND */ int ArduinoInputPin = 0; //Tells the Arduino your sensor's yellow wire is connected to Arduino Analog Pin 0 (A0) int sensorReading = 0; //Initializing the variable to store the sensor reading into void setup() { Serial.begin(9600); //starts the serial monitor so we can print the output to the Serial Monitor } void loop() { sensorReading = analogRead(ArduinoInputPin); //store the value from the sensor to the variable Serial.println(val); //print the value from the sensor so we can see it in the Serial Monitor delay(500); }