Reputation: 95518
Disclaimer: This is homework.
I'm taking an Arduino class and for our project we have to implement a simple sketch. The hardware involved is the Arduino Mega ADK board and the Electronic Brick Starter Kit. I have been able to successfully communicate with the Arduino with my sketches; other things (like the push-button, and LED's) seem to work, except for the LCD. I've followed numerous tutorials (including the on sample program for LCD's in my second link), but I can't get anything to work. My LCD consistently shows black boxes in the bottom line. From looking around, I see that black boxes show up when the LCD isn't connected properly. However, this is a starter kit which contains cables that you can hook up to a chassis, which gets rid of the pain involved in soldering individual wires. Is there something wrong with my LCD? Here's a simple sketch that I'm unable to get to work:
#include <LiquidCrystal.h>
LiquidCrystal lcd(10,11,12,13,14,15,16);
void setup()
{
Serial.begin( 9600 );
lcd.begin(16, 2);
lcd.clear();
}
void loop()
{
lcd.setCursor(0,0);
lcd.println( "hello world! ");
delay(1000);
}
The pins correspond to BUS2 and I've properly hooked up my cable from BUS2 to the LCD.
Upvotes: 3
Views: 28961
Reputation: 1
Its either due to bad wiring or contrast adjustment pin of the LCD ,just connect a variable resistance at the contrast pin and adjust your contrast and this may solve your problem.
Upvotes: 0
Reputation: 1
I had the same issue. I retested by cables to find two bad wires. After changing these I still had the same issue. Next step, I solder the pins strip to the LCD. I had seen many posts on this and thought I knew better. Well, after welding the pins strip to the LCD, MAGIC! All goes well if you follow the steps of others carefully.
Upvotes: 0
Reputation: 3980
My LCD consistently shows black boxes in the bottom line.
I had similar problem. Was connecting the LCD using minimum number of pins: LiquidCrystal(rs, enable, d4, d5, d6, d7)
. The problem I had is that I didn't connect R/W
(Read/Write) pin of the lcd to GND. When I did this - it has started to work. Also I found useful to add a 3.3k resistor from Vo
(Contrast Adj) to GND so the text can be read easily.
Upvotes: 3
Reputation: 21
Please ensure that you have all your header pins soldered ok in the LCD.
If you are using header pins without soldering in the 16 holes of you LCD move your LCD until you find a stable position for testing. Its easy that not all of them are contacting
This basic helloworld example should work http://www.arduino.cc/en/Tutorial/LiquidCrystal
For testing push load in the arduino IDE for uploading the script. Reset button in the arduino board sometimes is no initializing the LCD
Upvotes: 2
Reputation: 11
You should check your LiquidCrystal lcd(). Got the same problem and i adjusted this and now it works.
Upvotes: 1
Reputation: 1
I tried your code except the LCD declaration "LiquidCrystal lcd(10,11,12,13,14,15,16);" The sketch works and the LCD shows the message.
My devices are:
I suspect something in trouble in your LCD declaration section. My code is as follows(from the arduino example of "hello world" in the "LiquidCrystal":
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
As you understand, the pin connections in the above declaration are:
Arduino/LCD
I'm a newbie for Arduino world. Just trying to communicate the amazement I'm feeling about Arduino experience. Please inform me if you still have some problems.
Upvotes: 0
Reputation: 49104
You need to do step-wise problem solving. For example:
Test that your sketch works by running your sketch on a friend's hardware that is working well for him. If your sketch works then you know that the problem is in your hardware if it fails then the problem is in your software (sketch).
If the problem is hardware: swap your suspect lcd with a friend's that is working correctly. If it now works then you know that your lcd is bad.
If swapping lcd's doesn't help then swap main boards. Eventually, if you start with a suspect system (also know as the System Under Test) and with a known-good system (also called a "Gold System") then you should be able to tell which parts of the System Under Test are working and which aren't.
Additional comments
This entire exercise of figuring out what is wrong is, itself, a worthy exercise. Be sure to keep careful notes of what you are trying. Writing up your notes can be a valuable document for others in your predicament.
A good experimental setup would also carefully include a known-good (gold) system for use in diagnosing issues.
Each swappable unit (also known as a FRU or Field Replacable Unit) needs a good label. The label is used to make sure that you don't get the good and suspect FRUs mixed up. Since they are identical in every way (except one works and the other may or may not) it is easy to get them mixed up.
Be careful when swapping a known-good for a suspect FRU: if appropriate use anti-static precautions. Ground the systems correctly. Make sure that all connections are correct.
Upvotes: 0
Reputation: 66263
Black boxes in the lower line usually indicate, that the LCD did not receive the required initialisation commands. Causes may be wrong cabling - the commands go to nirvana but not to the LCD.
So you should
double check every switch on the board, the shield and the LCD module itself - are they in the right state?
double check, that the right sketch is actually on the Arduino.
Insert a delay(1000);
just before lcd.begin(...)
- Perhaps the LCD needs some more time for startup
If this this homework, then you can test your LCD on a mate's or the teacher's Arduino.
Your LCD might be bad. But the problem of wrong initialisation comes up so often on this site and on other forums, that the probability indicates it is OK.
Upvotes: 0
Reputation: 1655
With that pre-build lcd board, its not clear what adjustments you have available to you. But if the LCD shows black boxes that correspond to what you are writing to it (like if you wrote "hello world!", and you see 12 black boxes for each character and space, then its possible that the LCD voltage is too high. If you don't have any way to adjust the voltage to the LCD, then perhaps using a lower voltage power supply to the arduino (in case your LCD is getting the input voltage, and not the adjusted 5V supply.
Upvotes: 0