View unanswered posts | View active topics It is currently Sun Sep 21, 2014 12:04 am






Reply to topic  [ 4 posts ] 
encoder problem 
Author Message
Rookie

Joined: Thu Jun 27, 2013 7:52 pm
Posts: 3
Post 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]


Fri Jun 28, 2013 10:51 pm
Profile
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post 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.

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Fri Jun 28, 2013 11:27 pm
Profile WWW
Rookie
User avatar

Joined: Tue Jun 18, 2013 10:02 pm
Posts: 12
Post 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

_________________
VEX team 3018 - TechnaPWN Robotics
Website: http://technapwn.com
YouTube: http://www.youtube.com/user/TechnaPWN/videos


Wed Jul 03, 2013 2:28 pm
Profile WWW
Rookie

Joined: Thu Jun 27, 2013 7:52 pm
Posts: 3
Post Re: encoder problem
thanks for the help I got it


Sat Jul 06, 2013 8:04 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.