Go to Post We all need to keep things in perspective. When you look back at the entire 2005 FIRST season, is your entire experience defined by the presence of a little cloth flag on the play field? - dlavery [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
  #7   Spotlight this post!  
Unread 26-01-2004, 23:21
LoyolaCubs LoyolaCubs is offline
Registered User
#1453
 
Join Date: Jan 2004
Location: Los Angeles
Posts: 3
LoyolaCubs is an unknown quantity at this point
Re: problems assigning unsigned chars in FRC Code

Thanks all for your help. I got the autonomous dead reckoning working. Now I better move on to the harder stuff...

Btw, I learned that while loops in the Drive_Forward function are a bad idea. The counter should really be added to in the main loop that takes 26.2 ms. If you throw a while loop in the Drive_Forward function, the loop can take too long and anger the main program. Therefore, we have something like this:

void Drive_Forward()
{
pwm01 = 254;
pwm02 = 254;
}

Then down in the main loop:

{//loopy part
...
counter++;

if( counter < 100 && counter >= 50 )
{
Drive_Forward();
}
...
}

Eventually, we will use a timer rather than a counter to time movements. This is one reason C is so much more powerful than PBASIC. Anyway, I hope this lesson we learned helps you.
 


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
FRC default code hedgehogger Programming 2 21-01-2004 18:41
Problem with FRC Default code AsimC Programming 2 11-01-2004 19:22
ADC problems with C library and new code Larry Barello Programming 1 09-01-2004 22:31


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

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