View Single Post
  #2   Spotlight this post!  
Unread 14-11-2012, 15:46
maths222 maths222 is offline
FTC FTA
AKA: Jacob Burroughs
no team
 
Join Date: Nov 2011
Rookie Year: 2010
Location: United States
Posts: 148
maths222 is a splendid one to beholdmaths222 is a splendid one to beholdmaths222 is a splendid one to beholdmaths222 is a splendid one to beholdmaths222 is a splendid one to beholdmaths222 is a splendid one to beholdmaths222 is a splendid one to behold
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
Reply With Quote