Go to Post Who am I kidding, FIRST is so much cooler now than it was when I was a youngin'! - Michael Corsetto [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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
  #3   Spotlight this post!  
Unread 21-02-2013, 07:40
tlewis tlewis is offline
Registered User
None #0138
 
Join Date: Feb 2012
Location: NH
Posts: 3
tlewis is an unknown quantity at this point
Re: Wierd Robot Problems

And at the end of your driving() routine, the line:
if (gyroe=true){

likely doesn't do what you want.....it does not test to see if the value of "gyroe" is "true", but assigns the value "true" to the variable "gyroe", then evaluates the result -- which will ALWAYS be true. What you want is:
if (gyroe==true){

You can catch these errors at compile time if you write it this way:
if (true == gyroe){

because then if you forget one of the equal signs, then you are attempting to assign a value to the constant "true", which the compiler will flag as an error. I learned that the hard way. More than once.
Reply With Quote
 


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


All times are GMT -5. The time now is 03:30.

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