Paul van der Wielen
/
Reflow_Oven_Controller
based on existing code, added support for max31855 and i2c display
Diff: lc_display.h
- Revision:
- 2:67c271b56755
- Parent:
- 0:1f9875adab5d
--- a/lc_display.h Fri Jan 17 15:58:39 2014 +0000 +++ b/lc_display.h Sun Jan 19 14:09:22 2014 +0000 @@ -181,14 +181,14 @@ } void _WriteLCD(int Cmd, char *par1, int par2) { -// par2 maintained in call but no longer used +// 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 < strlen(par1); i++) { + for (i = 0; i < (par2 != 0) ? par2 : strlen(par1); i++) { i2c.write(par1[i]); } i2c.stop();