|
Re: FTC 2012 RobotC IR Sensor Programming and implementation
I use this code: https://hprobotics.googlecode.com/sv...IRController.h to get a more accurate reading from the sensor. Additionally, I use two controllers with the following code:
dir=IRGetACDir(IRSLeft)-(10-IRGetACDir(IRSRight));
if (dir<0)
{
leftSpeed(-50);
rightSpeed(50);
}
if (dir>0)
{
leftSpeed(50);
rightSpeed(-50);
}
if (dir==0)
{
leftSpeed(50);
rightSpeed(50);
}
__________________
--Jacob
Illinois FTC FTA
|