Go to Post Backwards PWMs happen to the best of us. - Woolly [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

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-09-2005, 21:46
devicenull devicenull is offline
Robot? We need a robot?
no team
 
Join Date: Sep 2004
Rookie Year: 1234
Location: n/a
Posts: 359
devicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nice
Re: Array problems( i think....)

Code:
while( i<90)
{
left_side[i]=p1_y;
right_side[i]=p2_y;
}
You forgot i++;, so its just an infinite loop.
  #2   Spotlight this post!  
Unread 21-09-2005, 21:58
jdiwnab's Avatar
jdiwnab jdiwnab is offline
Really the Inventor Guy
AKA: Bryan Hartley
FRC #0617
Team Role: College Student
 
Join Date: Nov 2004
Rookie Year: 2002
Location: Highland Springs, VA
Posts: 260
jdiwnab is a jewel in the roughjdiwnab is a jewel in the roughjdiwnab is a jewel in the rough
Re: Array problems( i think....)

Quote:
Originally Posted by devicenull
Code:
while( i<90)
{
left_side[i]=p1_y;
right_side[i]=p2_y;
}
You forgot i++;, so its just an infinite loop.
True, but also, that loop would record the same values about 90 times (+/- 1). Better would be to have the record code in the main program and just do 2 if's (if button and i<90) so that it records what you do. Then in the replay code, use for(i=0, i<90, i++) {...} so that it will loop though it that number of times. This makes changing your code easier and easier to read.

<edit>
Quote:
Originally Posted by sciguy125
I'm also not sure if this is legal:
Code:
   pwm01,pwm02=127;
But, I guess if the compiler didn't complain, it's alright.
A better way would be "pwm01=pwm02=127;" becuase pwm02 then is 127, afterword, pwm01 would be set equal to pwm02, making pwm01 127. You could check the values with a debugger or have some visual output, but I don't think "pwm01,pwm02=127" does what you think it does, but it isn't the cause of the problem.
__________________
Proof that Macs will win the platform war: How did Scotty know how to use MacDraft in Star Trek IV?
// random()
I have 100 gmail invites. PM me if you want one.
If they want us to think outside of the box, why do they make us fit in a 38x28x60 inch box?
Beware of Geeks bearing GIFs
Help me test my server software

Last edited by jdiwnab : 21-09-2005 at 22:09.
Closed Thread


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
Array Problems: Possible<stdio.h> Alex Wijtowych Programming 7 26-01-2005 04:39
Robot Rodeo - fixing control problems Gary Dillard Off-Season Events 7 26-10-2004 00:46
Do you all have problems with.... Munkaboo Website Design/Showcase 19 03-03-2003 19:51
Joystick problems archiver 2001 3 24-06-2002 02:40


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

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