Pages: [1]   Go Down
Author Topic: display not changing contrast dramatically depending on what is displayed  (Read 500 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using https://www.sparkfun.com/products/9052 on an Arduino Uno, IDE 1.0.5 on Windows7.
When I try to write to the display, a string ending in punctuation will not work (LCD goes blank), but the same string without punctuation at the end works. Even if I just use another letter at the end, it works, and if I use a ":" it does not.
Luckily I can just exclude punctuation in this case, but this seems really strange so I was wondering: has anyone else seen this and has an idea what is going on?
Program is supposed to cycle between displaying "wait for it" and "hit"; when I end either string with punctuation LCD remains blank for that second. I included a line that will work, commented out, and one that does not.
Here is the code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
  lcd.begin(16, 2);
}
void loop() {
   lcd.clear();  
  //lcd.print("wait for it"); // works
  lcd.print("wait for it."); //doesn't work  
  delay(1000);  
  lcd.clear();
  lcd.print("hit");
  delay(1000);
}


Update: it turns out the display isn't staying blank, but instead the contrast changes so dramatically between the "hit" and the "wait for it" that it looks like blank unless I up the contrast to the point where the "hit" is almost unreadable. What would cause that?
« Last Edit: October 08, 2013, 10:24:29 am by tenbergen » Logged

Israel
Offline Offline
Sr. Member
****
Karma: 5
Posts: 281
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Is it connected to 5V or 3.3V rail on your Arduino?
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The power for both the backlight and the controller are connected to 3.3V. I am not sure what you mean by "rail", though...
Logged

Pages: [1]   Go Up
Jump to: