> I thought this should work: > > // In main.c > #define WIDGIT_OUT LATC1 > #include "widgit.h" > > // In widgit.h > #ifndef WIDGIT_OUT > #warning Output pin not defined! > #endif > /* #define WIDGIT_OUT LATC1 <-- Now in main.c */ > > But it appears that this doesn't work. I get errors from widgit.c about > WIDGIT_OUT being an undefined identifier, using #ifndef/#warning in > widgit.h also prints the message. This approach should work. Did you include widgit.h in widgit.c? > 2) What ways people use to write reusable code. Another trick (that is somewhat compiler-dependent) is to have widgit.h=20 include widgit-pins.h, which is in the project directory. This how it is=20 done in Jal. This configuration problem is one of the reasons I like using C++, where=20 I can create a pin class, and pass objects to the widget constructor. --=20 Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products docent Hogeschool van Utrecht: www.voti.nl/hvu C++ on uC blog: http://www.voti.nl/erblog --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .