View unanswered posts | View active topics It is currently Sat Aug 24, 2019 9:54 am

 Page 1 of 1 [ 4 posts ]
 Print view Previous topic | Next topic
encoder problem
Author Message
Rookie

Joined: Thu Jun 27, 2013 7:52 pm
Posts: 3
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 Bwhile(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
Senior Roboticist

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

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

Wed Jul 03, 2013 2:28 pm
Rookie

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

Sat Jul 06, 2013 8:04 pm
Display posts from previous:  Sort by
 Page 1 of 1 [ 4 posts ]

#### Who is online

Users browsing this forum: No registered users and 1 guest

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

Search for:
 Jump to:  Select a forum ------------------ ROBOTC Applications    ROBOTC for LEGO MINDSTORMS       Third-party sensors    ROBOTC for CORTEX & PIC    ROBOTC for VEX IQ    ROBOTC for Arduino    Robot Virtual Worlds    Multi-Robot Communications    Issues and Bugs Competitions & Partners    Mini Urban Challenge    CS2N Robot Virtual Worlds Competitions       VEX Skyrise Competition 2014-2015       VEX Toss Up 2013-2014       FTC Block Party! 2013-2014    Competitions using VEX - BEST, TSA, VEX, and RoboFest!    FTC Programming    RoboCup Junior and Other ROBOT Competitions Virtual Brick Robotics Discussions    General Discussions    Project Discussions Off-Topic ROBOTC Forum & ROBOTC.net Suggestions/Feedback    ROBOTC Forums Suggestions/Comments    ROBOTC.net Suggestions/Comments       NXT Programming: Tips for Beginning with ROBOTC       VEX Programming: Tips for Beginning with ROBOTC    2013 Robotics Summer Of Learning       VEX Toss Up Programming Challenge       FTC Ring It Up! Programming Challenge    International Forums       Spanish Forums          ROBOTC for MINDSTORMS          ROBOTC for VEX       French Forums          ROBOTC pour Mindstorms          ROBOTC pour IFI VEX       Japanese Forums （日本語のフォーラム）       German Forums    2015 Spring Carnival Event    PLTW (Project Lead The Way)    Robotics Merit Badge    2014 Robotics Academy Summer of Learning