Code: how you take the mean out of sensor readings

Printer-friendly version

#pragma config(Sensor, S1,     Right,          sensorI2CHiTechnicCompass)
#pragma config(Sensor, S2,     middle,         sensorI2CHiTechnicCompass)
#pragma config(Sensor, S3,     left,           sensorI2CHiTechnicCompass)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main
int Useme = ((Right+ middle + left)/3);
to put it simple you are using the 3 sensors and getting the mean of them you then useing that data to program your robot