Go to Post IF teams did NOT READ THE FIRST MANUAL AND Q&A SITE, it is not FIRST's fault, it is the TEAM'S fault - sburro [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 06-01-2007, 00:18
Generalx5's Avatar
Generalx5 Generalx5 is offline
Hard Core Inventor
AKA: Jun(John) Zheng
FRC #1346 (Trobotics)
Team Role: Student
 
Join Date: Nov 2005
Rookie Year: 2004
Location: CANADA
Posts: 94
Generalx5 will become famous soon enough
Re: Why it works with an underscore?

NVM that last one I got it figured out, it was just a simple ";" mistake, I added an extra ; at the end of the text to replace.

Alright heres the new problem...

I have a bunch of if statements and they rely on a bunch of sensors,

when these sensors read a certain set of digital values it would turn on certain solenoids, correct, but! if these digital values from the sensors changed (knowing this from printf), the solenoids stay the same. They do not change with the input so I'm guessing that I'm doing something wrong with the if statements.

I have a lot of if's and in the very bottom on all the if statements, there would be an else if statement to eliminate any other undefined sensor readings.

any suggestions to what I'm doing wrong?

************************************************** ************

Ah! yes, I found the mistakes there, I've been reading the powerpoint tutorials from IFI and it got me confused. I start putting ; and brackets all over the place....I'll remember it for next time.

Last edited by Generalx5 : 06-01-2007 at 00:48. Reason: Added part under the * line.
  #2   Spotlight this post!  
Unread 06-01-2007, 03:59
John Gutmann John Gutmann is offline
I'm right here
AKA: sparksandtabs
FRC #0340 (GRR)
Team Role: Mechanical
 
Join Date: Feb 2005
Rookie Year: 2004
Location: rochester
Posts: 804
John Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant future
Send a message via AIM to John Gutmann Send a message via MSN to John Gutmann Send a message via Yahoo to John Gutmann
Re: Why it works with an underscore?

You can also use #define in your header files

#ifndef header_h__
#define header_h_

stuff stuff stuff

#endif

Then if you put #include "header.h" more then once it will say hey! header_h__ is already defined stupid! you can't define it again!! and just exit........
  #3   Spotlight this post!  
Unread 06-01-2007, 04:01
John Gutmann John Gutmann is offline
I'm right here
AKA: sparksandtabs
FRC #0340 (GRR)
Team Role: Mechanical
 
Join Date: Feb 2005
Rookie Year: 2004
Location: rochester
Posts: 804
John Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant future
Send a message via AIM to John Gutmann Send a message via MSN to John Gutmann Send a message via Yahoo to John Gutmann
Re: Why it works with an underscore?

Quote:
Originally Posted by Generalx5 View Post
NVM that last one I got it figured out, it was just a simple ";" mistake, I added an extra ; at the end of the text to replace.

Alright heres the new problem...

I have a bunch of if statements and they rely on a bunch of sensors,

when these sensors read a certain set of digital values it would turn on certain solenoids, correct, but! if these digital values from the sensors changed (knowing this from printf), the solenoids stay the same. They do not change with the input so I'm guessing that I'm doing something wrong with the if statements.

I have a lot of if's and in the very bottom on all the if statements, there would be an else if statement to eliminate any other undefined sensor readings.

any suggestions to what I'm doing wrong?

************************************************** ************

Ah! yes, I found the mistakes there, I've been reading the powerpoint tutorials from IFI and it got me confused. I start putting ; and brackets all over the place....I'll remember it for next time.

You could use a switch loop.

**Somebody please correct me if I am wrong, I don't remember is switch is only C++ or c too.
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
A poximity sensor that works with IFI gear Validius Control System 10 16-03-2005 21:56
A poximity sensor that works with IFI gear Validius Electrical 10 16-03-2005 21:56
Why is Dave hanging out with these guys? JohnBoucher NASA Discussion 1 17-12-2004 10:38
RoboEmu 1.06 (works with XP and 2k) rbayer Programming 4 20-10-2002 21:47
Are you a team with very little money, why/ mnkysp6353 General Forum 6 09-10-2001 21:30


All times are GMT -5. The time now is 01:24.

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