From ecf42a831c249f7c2d677f81cf220debb4122d8c Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 22 Jan 2018 00:01:57 +0100 Subject: [PATCH] fixed garbled output with println I got garbled output on my LCD when using the println function. I noticed a sleep(2) after almost every write operation in the code, but not after selecting the right line in the println function. I added that line and I have no more garbled output. --- lcdi2c.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lcdi2c.js b/lcdi2c.js index f26791f..1722c3f 100644 --- a/lcdi2c.js +++ b/lcdi2c.js @@ -219,7 +219,8 @@ LCD.prototype.println = function ( str, line ) { //Set cursor to correct line. if ( line > 0 && line <= this.rows ) { - this.write( LCD.LINEADDRESS[line], displayPorts.CMD ); + this.write( LCD.LINEADDRESS[line], displayPorts.CMD ); + this._sleep(2); }; this.print( str.substring(0, this.cols ) );