Example: Take the mean of the multiple sensors
With so many variables and when so many things can go wrong why not use more than one sensor this will allow you to become more accurate consistently you will not be able to get a set number every time but you will be able to get a lot closer to the real number every time overall you give up a little bit of Persian to gain a lot of constancy.
How you need to space out the sensors
The most important part is that the sensor needs to be in parallel if they are not your numbers will be really off. You also want to space them out so that if you of them picks up a magnetic field not all of them.
- Log in to post comments
how you take the mean out of sensor readings
#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
*/
}
- Log in to post comments
- Log in to post comments