Go Down

Topic: Sainsmart UNO - LCD QC2004A not responding (Read 30 times) previous topic - next topic

Dingbats

Hello everybody.

First post and I hope I've  put it in the right place !
I should also mention that I have no experience with an Arduino.

The problem:
The LCD displays nothing from the Arduino.
By changing the contrast on the LCD only lines 1 & 3 change - 2 & 4 do nothing.

I bought the Sainsmart UNO and LCD QC2004A, and downloaded and installed the sketch and library that came with it.

I also bought a FM sender/receiver and a 16 key keypad - these work just as they should.

I have tried numerous libraries with no effect. I've tried pins A4/A5 and the 2 dedicated slots.

Having done a lot of searching I have realised that a lot of other people were having the same problem but unfortunately none of the help given has worked for me.

In the basic sketch "HelloWorld", it never gets past lcd.begin(0x3f,20,4); or lcd.init();. I've looked into the bus address issue as well.  There I ran into another well known problem. The I2C scanners all use Wire.endTransmission() which hangs - which also remains unsolved.

My sytem set-up:
Windows 7 professional
Arduino IDE 1.6.1
Arduino: ATMEGA16U2 Version Uno R3 MEGA328P
LCD:    Interface: I2C
    I2C Address: 0x3F or 0x27      (from datasheet)
    Pin Definition : GND、VCC、SDA、SCL
    Supply voltage: 5V          (through USB)
Libraries:   you name it - it's probably on my hard-drive somewhere !

I'm out of ideas. I've been scratching my head for over 2 weeks now and am slowly starting to give up.

Can anybody offer any tips or suggestions ?

Many thanks
David

cattledog

Quote
The I2C scanners all use Wire.endTransmission() which hangs - which also remains unsolved.
You need to resolve this problem first. If there is a problem with the i2c bus then there is no way you can write to the lcd.

Does the i2c scanner code belolw hang up when you run it with nothing attached to the UNO. If it does, then there is most likely a problem with pin A4 or A5. Often it is an internal short with one of the pins. You can usually confirm defective pins by checking A4/A5 with analog read.
Code: [Select]
/ I2C Scanner
// Written by Nick Gammon
// Date: 20th April 2011

#include <Wire.h>

void setup() {
  Serial.begin (115200);

  // Leonardo: wait for serial port to connect
  while (!Serial)
    {
    }

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
 
  Wire.begin();
  for (byte i = 8; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy