Go to Post It’s not that we don’t have the time to teach first principals; it’s more that we (FIRST) don’t need to. - Jack Jones [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 16-02-2004, 15:03
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Odd counter problems

Quote:
Originally Posted by rbayer
A few things I saw after glancing at it:
Code:
if (armcounter = 15) //will raise arm.
   pwm06=0;
else 
   armcounter++;
   pwm06=255;
sould be
Code:
if (armcounter == 15) //will raise arm.
   pwm06=0;
else {
   armcounter++;
   pwm06=255; 
}
It is VERY rare that you'll actually want to use a single = in an if, so watch out for that, and also be careful with your curly braces.

That said, I believe the code in its original form should have printf'd 15 over and over and over. Was it doing that, or just not printing anything?
Missing a = is an easy thing to do. It's one of those powerful, useful things that C/C++ lets you do, but isn't what you want most of the time.
__________________

  #2   Spotlight this post!  
Unread 16-02-2004, 15:08
Catastrophy Catastrophy is offline
Registered User
AKA: Vince
#0704
Team Role: Programmer
 
Join Date: Feb 2004
Location: Grand Prairie
Posts: 18
Catastrophy is an unknown quantity at this point
Send a message via AIM to Catastrophy Send a message via MSN to Catastrophy
Re: Odd counter problems

Well the = was something i accidently did when moving it i had it in the code i was using. and btw its just not printing anything.
  #3   Spotlight this post!  
Unread 16-02-2004, 15:09
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Odd counter problems

Quote:
Originally Posted by Catastrophy
Well the = was something i accidently did when moving it i had it in the code i was using. and btw its just not printing anything.
So, the "test" prints, but the other thing doesn't?
__________________

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
Meeting FIRST People in odd places Jeff Waegelin General Forum 219 04-03-2012 13:10
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
A couple of problems I observed at the MAR archiver 2000 3 23-06-2002 22:27
Radio problems -- not archiver 2000 1 23-06-2002 22:23


All times are GMT -5. The time now is 05: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