Hi,
Since you're using these variables in the delay() functions I presume they're typed as integers, however I don't see you declaring them nor giving them a value in this code segment. Without that, this won't work. But I presume you have that somewhere so to get them to output in a neat row under your headings is simple however you've got to deal with being limited to 16 characters by 2 rows, so it will take some juggling depending on the values of each, and since you've allowed 9 spaces between each heading I can only presume they could be up to 10 chars long when represented on screen...so maybe something like this will help:
// in loop() function
lcd.Clear();
lcd.print("a: "); // allows space for 14 char variable value next
lcd.print(a);
lcd.setCursor(0,1); // 1st position on 2nd row
lcd.print("b:");
lcd.print(b);
delay(500); // ugly, but you need to allow time to read! deduct these delays from your overall loop delay
lcd.Clear();
lcd.print("c: ");
lcd.print(c);
lcd.setCursor(0,1); // 1st position on 2nd row
lcd.print("d:");
lcd.print(d);
delay(500);
lcd.Clear();
lcd.print("e: ");
lcd.print(e);
lcd.setCursor(0,1); // 1st position on 2nd row
lcd.print("f:");
lcd.print(f);
delay(500);
You'll find this can be simplified by using an array rather than individual variables for the delays.
// declared globally
int valueArray[6];
// and then, in loop() function
for(int i = 0; i <6; i=i+2) {
lcd.Clear();
for(int j=0; j <2; j++) {
lcd.setCursor(0,j);
lcd.print("[");
lcd.print(i+j);
lcd.print("]:"); // allows space for 12 char variable value next
lcd.print(valueArray[i+j]);
}
delay(500); // allow time to read your display
}
Apologies if I've introduced any errors by coding-as-I-type...
Cheers ! Geoff
[edit: grr already I fixed 2 typos in my code, hopefully this works now !]