Skip to content

Commit

Permalink
fixed garbled output with println
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexfederlin authored Jan 21, 2018
1 parent 6714288 commit ecf42a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lcdi2c.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
Expand Down

0 comments on commit ecf42a8

Please sign in to comment.