Page 2 of 2

Re: motor problems

Posted: 13 Mar 2014, 12:30
by h-g-t
Some useful NXC guides -

http://www.engineering.uiowa.edu/~cie/L ... torial.pdf

http://bricxcc.sourceforge.net/nbc/nxcdoc/

Did you get your program working yet?

Re: motor problems

Posted: 16 Mar 2014, 16:53
by ninjaman1138
hello

thanks for your help, im going to use the rotatemotor command instead as that does exactly what is want without the extra fuss.

I am having a problem though with a line follower program. I can get the robot to follow the line and turn but it wont turn back the other way.
im thinking that if i get it to turn so many degrees right and then back the other way twice as much it should find the line. i am having trouble setting the degrees and turning it the right amount

at the moment im using the example in the nxc tutorial pdf by Daniele benedettelli

#define THRESHOLD 40

task main()
{
SetSensorLight(IN_3);
OnFwd(OUT_AC, 50);

while(true)
{
if (Sensor(IN_3) > THRESHOLD)
{
OnFwd(OUT_A, 50);
Wait(100);
until(Sensor(IN_3) <= THRESHOLD);
OnFwd(OUT_AC, 50);
}
}
}

this is what i have been playing with. im thinking about trying to get the robot to turn using something other than the OnFwd command as i feel this doesn't really give you the turning control required. i will look further into the rotate motor commands. if anyone has any suggestions on this i would really appreciate the help!

thanks
simon