Go to Post And whether or not we are awarded in the course of the season, at its end our team will look back, and we’ll look at one another, and we will wonder how we were able to accomplish what we did. - John Wanninger [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 25-01-2011, 16:35
normpearii normpearii is offline
Fledgling Programmer
AKA: Norman Pearson II
FRC #2603 (Highland Robotics Team)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Medina, Ohio
Posts: 6
normpearii is an unknown quantity at this point
Send a message via ICQ to normpearii Send a message via AIM to normpearii Send a message via MSN to normpearii Send a message via Yahoo to normpearii
Encoder Help

We are having trouble getting our motors to go forward for 10 ticks of our encoders; this is how we are testing out encoder code to make sure it works.

MyRobot.cpp (Simple Template)
Our Declaration
Code:
Encoder encoderR;
Encoder encoderL;
double dblRight;
Our Init
Code:
encoderR(13,12),
encoderL(10,11)
Our Autonomous drive code
Code:
encoderR.Start();
encoderL.Start();
dblRight=encoderR.GetDistance();

if(dblRight>-10)
{
myRobot.Drive(0.5, 0.0); 	
dblRight=encoderR.GetDistance();
}
 				
else if(dblRight<=-10)
{
myRobot.Drive(0.0, 0.0); 	
dblRight=encoderR.GetDistance();
}
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:14.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi