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

encoder problem
http://robotc.net/forums/viewtopic.php?f=66&t=6089
Page 1 of 1

Author:  wdieckm [ Fri Jun 28, 2013 10:51 pm ]
Post subject:  encoder problem

when I program an encoder my robot does not run in a strait line always turns
Quote:
{ nMotorEncoder[motorB] = 0; // reset the Motor Encoder of Motor B
while(nMotorEncoder[motorB] < 1200)

motor[motorB]=50; // mover to first point
motor[motorC]=50;


motor[motorB]=0;//brake
motor[motorC]=0;
wait1Msec(1000); //pause
[code][/code]

Author:  NeXT-Generation [ Fri Jun 28, 2013 11:27 pm ]
Post subject:  Re: encoder problem

This is not proper code. Are you sure you pasted it in correctly? And please, provide the full code including your #pragmas.

Author:  JoeTPR [ Wed Jul 03, 2013 2:28 pm ]
Post subject:  Re: encoder problem

wdieckm wrote:
when I program an encoder my robot does not run in a strait line always turns

I put code tags around the code and indented it properly. Look closely, and see what is missing.
Code:
   nMotorEncoder[motorB] = 0;          // reset the Motor Encoder of Motor B
   while(nMotorEncoder[motorB] < 1200)

      motor[motorB]=50;   // move to first point
      motor[motorC]=50;


   motor[motorB]=0;//brake
   motor[motorC]=0;
   wait1Msec(1000);   //pause


If you don't see it...
http://www.robotc.net/wiki/Tutorials/Ar ... hile_Loops
http://www.robotc.net/NaturalLanguage/pdf/hp_while.pdf

Author:  wdieckm [ Sat Jul 06, 2013 8:04 pm ]
Post subject:  Re: encoder problem

thanks for the help I got it

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