| gnormhurst |
15-02-2005 16:28 |
Re: Drive Straight C Code using Encoders without PID?
Quote:
Originally Posted by Dave Flowerday
The compiler never even sees the names you've assigned to your #defines.
|
And compiler error messages reflect that: the compiler will point to a line of code and object to some text that isn't in that line of code -- it's in the #define
Code:
#define PI 3.14.159 // syntax error in macro
..
circum = PI * dia;
If the compiler quotes the code it doesn't like, it will quote "3.14.159", not "PI" while referring to the line "circum = PI * dia;". That's because it doesn't see "PI", only "3.14.159".
|