ROBOTC.net forums
http://www.robotc.net/forums/

Forward, lightsensor sees dark, back to SAME SPOT?
http://www.robotc.net/forums/viewtopic.php?f=1&t=601
Page 1 of 1

Author:  lostmom [ Fri Jun 06, 2008 12:32 pm ]
Post subject:  Forward, lightsensor sees dark, back to SAME SPOT?

How do I go foward until light sensor sees dark and then go back to the same spot that I started at :?:

Author:  mightor [ Fri Jun 06, 2008 12:54 pm ]
Post subject:  Re: Forward, lightsensor sees dark, back to SAME SPOT?

lostmom wrote:
How do I go foward until light sensor sees dark and then go back to the same spot that I started at :?:

Hiya Mum,

Before you start, reset your encoders using
Code:
nMotorEncoder[<your motor1>] = 0;
nMotorEncoder[<your motor2>] = 0;

Then go forward until you hit that spot then set nMotorEncoderTarget for both motors to 0 and hit reverse. This should *theoretically* work.

Regards,
Xander

Author:  lostmom [ Sat Jun 07, 2008 5:01 pm ]
Post subject:  Thanks

Thanks :D

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/