/* Testing 5 Analog ;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 dataint L_VDBValue; // Variable to hold Left VDB dataint R_VDBValue; // Variable to hold Right VDB dataconstint L_SharpPin = A9; //Pin connecting the sharpconstint C_SharpPin = A8; //Pin connecting the sharpconstint R_SharpPin = A7; //Pin connecting the sharpconstint L_VDBPin = A6; //Pin connecting the Left Voltage Divider Boardconstint R_VDBPin = A5; //Pin connecting the Right Voltage Divider Boardvoidsetup() {
// 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 sensor
L_VDBValue = analogRead(L_VDBPin); //Read the value of the VDB sensor
R_VDBValue = analogRead(R_VDBPin); //Read the value of the VDB 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.print("Left VDB Value = ");
Serial.println(L_VDBValue);
Serial.print("Right VDB Value = ");
Serial.println(R_VDBValue);
Serial.println(" ");
delay(1000);
}