motor problems

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
h-g-t
Posts: 552
Joined: 07 Jan 2011, 08:59
Location: Albania

Re: motor problems

Post 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?
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
ninjaman1138
Posts: 7
Joined: 07 Mar 2014, 23:29

Re: motor problems

Post 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
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 0 guests