8 years, 12 months ago.

Re: N5110: printString() and printChar() updated so that strings/chars are cut-off after the 83rd

It is better to replace 83 by WIDTH-1

Question relating to:

Library for interfacing to Nokia 5110 LCD display (as found on the SparkFun website). LCD, N5110, Nokia, pcd8544

1 Answer

8 years, 12 months ago.

Good idea. Was a quick fix to solve a bug. Will update soon and commit changes.

Accepted Answer

One more improvement to avoid flickering. A variable to disable refresh. ---------

  1. include "N5110.h"

bool lcdrefresh=true;

...

function to refresh the display void N5110::refresh() { if (!lcdrefresh) return; ... ---------

Then we can use something like this:

lcdrefresh=false; lcd.clear(); lcd.printString(s1,0,0); lcd.printChar('$',39,0); lcd.printString(s2,WIDTH-strlen(s)*6+1,0); lcd.printString(s3,0,5); lcdrefresh=true; lcd.refresh();

posted by Сергей Олейник 24 Apr 2015