Go to Post The longer you play robots, the more you realize that it's not about the robots. - dtengineering [more]
Home
Go Back   Chief Delphi > Technical > Programming
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 06-02-2006, 20:36
railerobotics's Avatar
railerobotics railerobotics is offline
Registered User
FRC #0935
 
Join Date: Jan 2006
Location: Newton, KS
Posts: 190
railerobotics will become famous soon enough
Autonomous problem

I have written this for atonomous code but the the robot does not stop when the counter reaches 2000. Anyone know why?

/* Add your own autonomous code here. */
switch (Step)
{
case 1:
{
stop = 2000;
crawl = (stop - 200);
slow = (stop - 100);

Left_Count = Get_Left_Encoder_Count();
Right_Count = Get_Right_Encoder_Count();
if (Left_Count < slow)
pwm03 = 220;
if (Left_Count > slow && Left_Count < crawl)
pwm03 =200;
if (Left_Count > crawl && Left_Count < stop)
pwm03 =150;
if (Left_Count >= stop)
pwm03 =127;
printf("Left Counter %ld\r", Left_Count);

if (Right_Count < slow)
pwm04 =220;
if (Right_Count > slow && Right_Count < crawl)
pwm04 =200;
if (Left_Count > crawl && Right_Count < stop)
pwm04 =150;
if (Right_Count >= stop)
pwm04 =127;
printf("Right Counter %ld\r", Right_Count);
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Autonomous Problem... JoeFryman Programming 2 19-02-2005 14:56
Future of Autonomous Mode FadyS. Programming 41 24-05-2004 19:45
problem with autonomous that has stumped all programmers so far bd02 Programming 32 10-03-2004 22:22
autonomous mode problem on field Chris_C Programming 17 26-03-2003 19:11
The problem with scouting... archiver 2001 10 23-06-2002 23:49


All times are GMT -5. The time now is 20:59.

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