LCD4Bit lib
i reading ladyada's lcd tutorial , suggests changing pins needed in lcd4bit.cpp file.
can't change variables in sketch? i prefer not change libraries because can lead nightmarish bugs if move code onto new system or reinstall.
can't change variables in sketch? i prefer not change libraries because can lead nightmarish bugs if move code onto new system or reinstall.
you need have pins in lcd4bit library source match physical wiring, library compiled before sketch setting variables in sketch won't change pin assignments.
although possible modify library pins can assigned when library initialized, compiler produce less efficient code if doesn't know pin numbers @ compile time, not recommend.
you add #define in library header file sketch can verify files in library directory has had personal attention.
putting following in lcd4bit.h header file:
#define mysource
and following in sketch uses library:
#ifndef mysource
source code not customized // generate compiler error if mysource not defined
#endif
so if accidently update lcd lib source files compiler complain, reminding change pin assignments ones use.
although possible modify library pins can assigned when library initialized, compiler produce less efficient code if doesn't know pin numbers @ compile time, not recommend.
you add #define in library header file sketch can verify files in library directory has had personal attention.
putting following in lcd4bit.h header file:
#define mysource
and following in sketch uses library:
#ifndef mysource
source code not customized // generate compiler error if mysource not defined
#endif
so if accidently update lcd lib source files compiler complain, reminding change pin assignments ones use.
Arduino Forum > Forum 2005-2010 (read only) > Software > Interfacing > LCD4Bit lib
arduino
Comments
Post a Comment