Free Republic
Browse · Search
News/Activism
Topics · Post Article

To: Cololeo
Nice.

Clarify for those new to this stuff what you mean by "call them from the loop."

26 posted on 10/21/2016 6:06:52 PM PDT by RoosterRedux
[ Post Reply | Private Reply | To 23 | View Replies ]


To: RoosterRedux
int zr=0; //Row #
int zc=0; // Column #
int zl=0; // string length if needed - ie: 4 for integers
int zt1=0; // temp1
String zs=" "; //string to print

void ezprint(int zc,int zr,String(zs),int zl) {
//zc = column zr = row zs = string variable zl = length
//zl is the length of the print area to clear
lcd.setCursor(zc,zr);
if (zl == 0) zl = zs.length();
for (zt1 = zl; zt1 > 0; zt1--) {
lcd.print(" "); }
lcd.setCursor(zc,zr);
lcd.print(zs);
}
//end ezprint


void setup() {
Serial.begin(9600);
Wire.begin();
lcd.begin(lcdw,lcdh);
lcd.clear();
}


void loop(){
a="Hello";
ezprint(0,0,a,5);

36 posted on 10/21/2016 6:36:49 PM PDT by Cololeo
[ Post Reply | Private Reply | To 26 | View Replies ]

Free Republic
Browse · Search
News/Activism
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson