PDA

View Full Version : Watch the SPELLING of your DEFINEs



Melanie
- 15th July 2004, 11:43
Did you know that the Compiler does not flag errors in your DEFINEs?

Is your program not working as expected?
Is the LCD not working properly?
Is your DEBUG not outputting correctly?
Do you have any DEFINEs in your program?

Then check them for accuracy and correct SPELLING

(see PIC Basic Manual Appendix listing all the DEFINEs).

Defines should be in UPPERCASE too.

Example:

You wanted to write...

DEFINE LCD_DREG PORTC

But accidentally you wrote...

DEFINE LCD_IVE_HAD_TOO_MUCH_BEER_DREG PORTC

The Compiler will NOT give you an error message, and will happily accept that you've had too much Beer... after all, it doesn't want to spoil your fun.