|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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. ![]() |
|
#2
|
||||
|
||||
|
Re: Wierd Robot Problems
Quote:
|
|
#3
|
|||
|
|||
|
Re: Wierd Robot Problems
WindRiver ships a (probably modified by them) 3.4.4 release of gcc. That bugfix version was released on May 18, 2005. The minor version, 3.4.0 (the last one to have new features, like warnings), was released April 20, 2004.
Hilariously, 3.4.4 isn't even the newest bugfix release (3.4.6 exists) I wouldn't count it as modern. That said, I haven't actually tested it to see if it emits a warning related to = in if statements. Last edited by codes02 : 21-02-2013 at 17:44. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|