I almost have this capacitance meter working good enough to build but I have been unable to figure out 2 things
1.) In the setup function I try to print a message.
lcd.print(" Cap Meter 20x4 "); // 20 char
lcd.print(" Rsel Func Lp100 "); // 20 char
Why does this not print on the first two rows of the display? .... it prints in row 0 and 2
2.) When charge through 10K (and 100K) is selected
avg_Time and uS is printed in row 0 at normal contrast
The capacitor value, units and charge resistor (R3) is printed in row 1 but the units uF, nF or pF and R3, R4 are
displayed at much lower contrast with the last thing displayed almost unreadable.
If I hold down the Read Cap button all the lines printed are the same contrast. It's probably easy but I'm just not seeing
why.
Hello
For question 1:
You should select where you want write on your lcd.
You have to use lcd.setCursor(x,y) where x is the number of the line (0-3 in your case) et y is the where you start to print (0-15).
Like that:
lcd.clear();
lcd.setCursor(0,0);//or lcd.home()
lcd.print(" Cap Meter 20x4 "); // 20 char
lcd.setCursor(1,0);
lcd.print(" Rsel Func Lp100 "); // 20 char
Thanks, I knew I could use setCursor but I thought since I printed 20 characters (counting the spaces) on a 20 x 4 display the next print statement would start on the next row ..... don't know why it's not working like that
Paul__B replied with my diagram ........ did you mean to post more?
It is working like that because on a 2004 display, the first line is continued on the third line and the second continues on the fourth. That is how the display is constructed, so as pointed out, if you want to put things on a particular line - at a particular place - you have to use setCursor.
Other than that, I was just helping with your diagram.
Q1.) ok thanks, I guess it just works like that. No problem now that I know
Q2.) any idea why the last thing printed is so faint? Another idiosyncrasy of the device? I don't see why the LCD won't just continue to display the last thing printed to it (it does) but all at the same contrast level (it doesn't).
Something to do with how I'm looping through the sketch? Because holding the Read Cap button down causes the contrast to be all the same.
A common mistake is to run a sketch that continuously re-prints the same data to the display. I haven't looked at your code because it is a little inconvenient, but you need to organise it so it only writes to the display when something actually changes, does not execute a lcd.clear(); in the loop() and uses cursor positioning to locate to the part that needs to be over-written and over-writes only that part.
I gather you have more-or-less mastered the contrast adjustment, but it is a good idea if you can to correct a design foul-up in many or most such displays by ensuring the contrast potentiometer is not connected to Vcc - 5 V - at one end, only to ground. This makes contrast stetting easier.