/* Testing 3 Sharp IR Sensors by Brian Patton 3/25/14 Feel free to do whatever you want with this code example */int L_SharpValue; // Variable to hold Left Sharp dataint C_SharpValue; // Variable to hold Center Sharp dataint R_SharpValue; // Variable to hold Right Sharp dataconstint L_SharpPin = A9; //Pin connecting the sharpconstint C_SharpPin = A8; //Pin connecting the sharpconstint R_SharpPin = A7; //Pin connecting the sharpvoidsetup() {
// Turn on Serial to displaySerial.begin(9600);
}
voidloop() {
L_SharpValue = analogRead(L_SharpPin); //Read the value of the sharp sensor
C_SharpValue = analogRead(C_SharpPin); //Read the value of the sharp sensor
R_SharpValue = analogRead(R_SharpPin); //Read the value of the sharp sensorSerial.println(" Princeton Sensor Diagnostics Mode ");
Serial.print("Left Sharp Value = ");
Serial.println(L_SharpValue);
Serial.print("Center Sharp Value = ");
Serial.println(C_SharpValue);
Serial.print("Right Sharp Value = ");
Serial.println(R_SharpValue);
Serial.println(" ");
delay(1000);
}