Let's Make Robots!

Damn those LCDs

Rightyo, sparkfun 16x2 serial lcd hooked up to 3.3v, gnd, and the tx pin on my arduino. I just want an example of really basic code that will print something on the lcd, i've searched the arduino site and google but none of the tutorials seem to make sense. is the move to x character command necessary? I just want print like the values from a sensor or what not which seems easy if i could just have it print something simple.

 

 this is my code:

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  Serial.write("hello");
}

it fails. 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

try using this:

/*   LiquidCrystal Library - Hello World    Demonstrates the use a 16x2 LCD display.  The LiquidCrystal  library works with all LCD displays that are compatible with the   Hitachi HD44780 driver. There are many of them out there, and you  can usually tell them by the 16-pin interface.    This sketch prints "Hello World!" to the LCD  and shows the time.     The circuit:  * LCD RS pin to digital pin 12  * LCD Enable pin to digital pin 11  * LCD D4 pin to digital pin 5  * LCD D5 pin to digital pin 4  * LCD D6 pin to digital pin 3  * LCD D7 pin to digital pin 2  * 10K resistor:  * ends to +5V and ground  * wiper to LCD VO pin (pin 3)    Library originally added 18 Apr 2008  by David A. Mellis  library modified 5 Jul 2009  by Limor Fried (http://www.ladyada.net)  example added 9 Jul 2009  by Tom Igoe  modified 8 Feb 2010  by Tom Igoe      http://www.arduino.cc/en/Tutorial/LiquidCrystal  */  // include the library code: #include <LiquidCrystal.h>  // initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2);  void setup() {   // set up the LCD's number of columns and rows:    lcd.begin(16, 2);   // Print a message to the LCD.   lcd.print("hello, world!"); }  void loop() {   // set the cursor to column 0, line 1   // (note: line 1 is the second row, since counting begins with 0):   lcd.setCursor(0, 1);   // print the number of seconds since reset:   lcd.print(millis()/1000); } 

 

 

i ohave an lcd that didn't work with this program, i had to change something in the connections, but i can't remember what :S 

 

I'm not too familiar with the Sparkfun LCDs.. I usually buy off-brand LCD's and make my own Serial lcd.. BUT.. if the LCD is 3.3v, you need to make SURE that it can take 5v signals.  Because the TX on the Arduino is 5v.. so if your signal is 5v, and it only accepts 3.3v signals... there's a good chance you'll fry it like you were saying.

 BUT, I believe most of the 3.3v LCD's can accept 5v signals.. just not the power source itself.  But I would never bet on it!

One thing to check is the commands for setting the Contrast.. with normal LCD's that's a common issue people run into.. forget to adjust their contrast properly. I'm not sure if you have the same one.. but from the SparkFunSerLCD link from above.. the contrast is on board with a potentiometer, you may need to adjust this.

Also you said:

i've been looking at that library and i tried the test code. nothing seems to be working. I don't even know if my LCD still works because i may have fried it. Can someone just give me a really basic script that says anything just to make sure my lcd still works? 

This is ... not very helpful.. what ISN'T working about it? What shows up? Is it blank? When you upload a sketch to your Arduino, and run it.. what happens? Etc... can you see boxes?

Have you tried other Baud rates?  They say the default is 9600.. but I remember reading on the Arduino forums somewhere that somebody purchased one and the baud rate was different.. 38400 I think, but try the others as well. (This won't damage it, it may print garbage on the LCD if it's the wrong speed, but that would be a good thing)

 

Also, try putting the Serial.print inside the Setup, but put a delay(500); or so.. there might be a "Setup delay" on the LCD.. takes a second or two to load.   But you want the Print inside the Setup so it only happens once.. if you loop it, it's trying to send that 1000 times a second to the LCD.. and the LCD is probably crying!:P

 

But regardless of if it can accept 3.3v and 5v signals... the 3.3V pin on the Arduino can only supply 50ma... period. Most likely not a problem.. but not to be overlooked! You might want to try a 3.3v regulator if you have one.. and use the supply from the 5v line.

i've been looking at that library and i tried the test code. nothing seems to be working. I don't even know if my LCD still works because i may have fried it. Can someone just give me a really basic script that says anything just to make sure my lcd still works? i've tried

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  Serial.write("hello");
}

I've also tried using serial.print, and serial.println.

i'm getting no reaction from the lcd

You probably fried it...
anyone else? I'm about to email sparkfun for mislabeling their serial backpack :/
I'm surprised Sparkfun would let something like this slip and not do anything about it. You might as well tell them and see if they try and fix it...

See if this makes any sense- http://www.arduino.cc/playground/Learning/SparkFunSerLCD

 

I personally use a CrystalFontz, very straightforward to use once you've figured it out. Just hook it up to TX and it's perfect...

Try using Serial.print.

Serial.write is a bit different, and actually kind of pointless.. seeing as you can do the same things with Serial.print.

 

One thing to be careful of, kind of on the same subject.. the 3.3v from the Arduino can only supply 50ma MAX. Anymore than that, and you can damage the 232 chip onboard that's used to talk to the computer. Most LCD controllers only run from like 1ma, to 5ma.. and even less sometimes.. but it's the backlight that can be a killer. One of mine runs at about 60ma! You should be fine.. but just a fair warning.. not sure how much the backlight draws.. and it might not get "damaged" immediately if it does at all.. sometimes it'll run fine for a while then one day, it's gone!

 

I do not know if he is using a 3.3v arduino.
i have both 5v and 3.3 available on my arduino, i think it's just the normal 2009