![](/media/cache/profiles/a7bf3f5462cc82062e41b3a2262e1a21.50x50_q85.jpg)
Yet another I2C Text based LCD display program
Diff: lc_display.h
- Revision:
- 2:91dec3d7903a
- Parent:
- 1:d8767e2b8e7e
--- a/lc_display.h Wed Mar 09 07:05:29 2011 +0000 +++ b/lc_display.h Sun Jan 19 14:23:58 2014 +0000 @@ -181,14 +181,14 @@ } void _WriteLCD(int Cmd, char *par1, int par2) { - +// par2 != 0 -> use par2 else actual length of string int i; int j = 1000; i2c.start(); i2c.write(I2C_ADDR); i2c.write(Cmd & 0xff); // Set Command - for (i = 0; i < par2; i++) { + for (i = 0; i < (par2 != 0) ? par2 : strlen(par1); i++) { i2c.write(par1[i]); } i2c.stop();