Pages: [1] 2   Go Down
Author Topic: Well i tried - LCD  (Read 1575 times)
0 Members and 1 Guest are viewing this topic.
Hamilton, Vic, Aus
Offline Offline
Newbie
*
Karma: 1
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Like i said, i would try find out what my LCD is capable of.
Ive spent 2 odd hours reading about I2C, and a lot of posts regarding the I2C LCDs.
Ive spent near an hour playing with all the examples.
Ive updated the LiquidCrystal library to 1.2.1.
Ive loaded the LiquidCrystal_I2C library.
Ive determined its address is 0x27.
And all i can get out of it is backlight sometimes on, others off, sometimes a quik flash.
And a line of solid characters.

So it will have to wait till i aquire further knowledge with I2C.
Then i will let you know if it can do the Extended ASCII set.

Thanks
Logged

Québec
Offline Offline
God Member
*****
Karma: 16
Posts: 653
What ever! I'm gonna do what I want. Screw you guys! I'm going home. And other Cartman stuff. ;)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

We sure would love to help smiley-wink but your not giving much details on your code, you lcd board or any thing.

Maybe if you would send both side picture and the code your using, this post would fill up instantly. smiley-razz
Logged

Words cannot express how much I hate you guys. As we fight our way northward into the great unknown, only that one thing remains certain...

Hamilton, Vic, Aus
Offline Offline
Newbie
*
Karma: 1
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Cheers mate,
but this I2C is a bit beyond me yet, i tried all sorts of code from lots of sites, and the examples, too many for me to have kept track of what i was doing!

Heres a picture anyway, from what i was reading, i think its the sainsmart one.
(I did it just to see if i could manage a simple run to try some Extended chars, but oh well)

So unless you can provide me with an example, or some quick help, to get it running..
I just went looking for the page i found how to connect it, ie. pins A4 and A5, but cant find it, and realise theres hundreds of pages regarding this out there :S. So like i said, its beyond me, and im wasting my time trying.

Thanks anyway smiley


* 1602A.jpg (179.2 KB, 800x449 - viewed 37 times.)
Logged

Québec
Offline Offline
God Member
*****
Karma: 16
Posts: 653
What ever! I'm gonna do what I want. Screw you guys! I'm going home. And other Cartman stuff. ;)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah I got one of those in the post comming. I just can't wait to try stuff on it. Tel me it was pré assembled?

Logged

Words cannot express how much I hate you guys. As we fight our way northward into the great unknown, only that one thing remains certain...

Québec
Offline Offline
God Member
*****
Karma: 16
Posts: 653
What ever! I'm gonna do what I want. Screw you guys! I'm going home. And other Cartman stuff. ;)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Be patient whit in a few day's ill get back to scream with you on this smiley-wink

Mean while some other might help. has soon i get the board Ill be able to help.

But one question, what happen if you remove the jumpper? and what happens if you put a LED instead?
Logged

Words cannot express how much I hate you guys. As we fight our way northward into the great unknown, only that one thing remains certain...

Québec
Offline Offline
God Member
*****
Karma: 16
Posts: 653
What ever! I'm gonna do what I want. Screw you guys! I'm going home. And other Cartman stuff. ;)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Show me your code you have tryed and got the most success with and tel me how many collumn and row is ther ont your thing.
Logged

Words cannot express how much I hate you guys. As we fight our way northward into the great unknown, only that one thing remains certain...

Hamilton, Vic, Aus
Offline Offline
Newbie
*
Karma: 1
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried all sorts of code from all sorts of websites, cant recall exactly. You will see most of them with Google, i searched this error at some point, and went through a few of the google results from it:

error: 'LiquidCrystal_I2C' does not name a type

(But that mustve been after i found out about that library, because i updated the LiquidCrystal library to 1.2.1 before i got as far as the I2C lib)

Pretty sure the jumper is just supplying power to the backlight, I read about controlling backlight from another pin, somewhere, so i assume you would remove jumper and connect pin to that.
Logged

Québec
Offline Offline
God Member
*****
Karma: 16
Posts: 653
What ever! I'm gonna do what I want. Screw you guys! I'm going home. And other Cartman stuff. ;)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well if your board is any like the one that is comming here is the chip set pdf.

http://www.nxp.com/documents/data_sheet/PCF8574.pdf

As you can see at page 4, there are only 3 address line, So I must assume that the address of you board is between 1 and 7, 0 being the master.

Wrong, the least significant bit is unused in the address register as we can see at page 7, that would mean that it's between 2 and 15.
« Last Edit: September 11, 2013, 10:18:11 pm by Frédéric_Plante » Logged

Words cannot express how much I hate you guys. As we fight our way northward into the great unknown, only that one thing remains certain...

Hamilton, Vic, Aus
Offline Offline
Newbie
*
Karma: 1
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

lol, like i said, I2C is way ahead of me.
I see that on page 4, but have no idea about what your talking about regarding the address.
All i know is my devices I2C address is 0x27.
And the picture i saw for connections was from here:
http://www.dfrobot.com/wiki/index.php/I2C/TWI_LCD1602_Module_%28SKU:_DFR0063%29
that code i tried too.
Lot of the code i also tried was from the examples everywhere in the IDE libraries...
« Last Edit: September 11, 2013, 10:25:58 pm by googs » Logged

Québec
Offline Offline
God Member
*****
Karma: 16
Posts: 653
What ever! I'm gonna do what I want. Screw you guys! I'm going home. And other Cartman stuff. ;)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Please, can you tel me the Chip ID, or if you prefer, the letter and numbers on the chip cause that would help lot.

And Also, Have you put a copy of the libraries in the libraries folder of you sketch folder, if not that error message could be caused by this
Logged

Words cannot express how much I hate you guys. As we fight our way northward into the great unknown, only that one thing remains certain...

Québec
Offline Offline
God Member
*****
Karma: 16
Posts: 653
What ever! I'm gonna do what I want. Screw you guys! I'm going home. And other Cartman stuff. ;)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just for the fun of it try I2c address 0x0E or 0x0F. Cause the 3 address line seam to be connected togeter to a source.

Yet I could be wrong the picture is dark around that part, but in the green square, and maybe right above this is where the chip get is address.


* i2c.jpg (79.63 KB, 800x553 - viewed 37 times.)
« Last Edit: September 11, 2013, 10:38:39 pm by Frédéric_Plante » Logged

Words cannot express how much I hate you guys. As we fight our way northward into the great unknown, only that one thing remains certain...

Hamilton, Vic, Aus
Offline Offline
Newbie
*
Karma: 1
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, well with this code:

Code:
//DFRobot.com
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
 
LiquidCrystal_I2C lcd(0x0F,16,2);  // set the LCD address to 0x27 for a 16 chars and 2 line display
 
void setup()
{
  lcd.init();                      // initialize the lcd
 
  // Print a message to the LCD.
  lcd.backlight();
  lcd.print("Hello, world!");
}
 
void loop()
{
}

Changing from 0x27 to 0E and 0F made no difference, just 1 line of solid characters, backlight is on.
Chip - PCF8574T
Logged

Québec
Offline Offline
God Member
*****
Karma: 16
Posts: 653
What ever! I'm gonna do what I want. Screw you guys! I'm going home. And other Cartman stuff. ;)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

solid characters hein? Have you tried lowering the contrast?
Logged

Words cannot express how much I hate you guys. As we fight our way northward into the great unknown, only that one thing remains certain...

Québec
Offline Offline
God Member
*****
Karma: 16
Posts: 653
What ever! I'm gonna do what I want. Screw you guys! I'm going home. And other Cartman stuff. ;)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok fisrt lower the contrast half way carefully

Second go to this page and copy paste the code you find and upload it

http://playground.arduino.cc/Main/I2cScanner

Once you have noted the address it give you, high probably not 27, correct the address in this code upload it and try it

Code:
/*
** Example Arduino sketch for SainSmart I2C LCD Screen 16x2
** based on https://bitbucket.org/celem/sainsmart-i2c-lcd/src/3adf8e0d2443/sainlcdtest.ino
** by
** Edward Comer
** LICENSE: GNU General Public License, version 3 (GPL-3.0)

** This example uses F Malpartida's NewLiquidCrystal library. Obtain from:
** https://bitbucket.org/fmalpartida/new-liquidcrystal

** Modified – Ian Brennan ianbren at hotmail.com 23-10-2012 to support Tutorial posted to Arduino.cc

** Written for and tested with Arduino 1.0
**
** NOTE: Tested on Arduino Uno whose I2C pins are A4==SDA, A5==SCL

*/
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>

#define I2C_ADDR    0x3F // <<----- Add your address here.  Find it from I2C Scanner
#define BACKLIGHT_PIN     3
#define En_pin  2
#define Rw_pin  1
#define Rs_pin  0
#define D4_pin  4
#define D5_pin  5
#define D6_pin  6
#define D7_pin  7

int n = 1;

LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

void setup()
{
  lcd.begin (16,2); //  <<----- My LCD was 16x2

 
// Switch on the backlight
lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
lcd.setBacklight(HIGH);
lcd.home (); // go home

  lcd.print("SainSmartI2C16x2"); 
}

void loop()
{
  // Backlight on/off every 3 seconds
  lcd.setCursor (0,1);        // go to start of 2nd line
  lcd.print(n++,DEC);
  lcd.setBacklight(LOW);      // Backlight off
  delay(3000);
  lcd.setBacklight(HIGH);     // Backlight on
  delay(3000);
}
Logged

Words cannot express how much I hate you guys. As we fight our way northward into the great unknown, only that one thing remains certain...

Hamilton, Vic, Aus
Offline Offline
Newbie
*
Karma: 1
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes, i just searched LCM1602 and found this thread, it may make sense to you, i will start trying some of that..
http://forum.arduino.cc/index.php?topic=158312.0

i gather mine is the first of the 3, as theres no markings of A0-A2 on it.


Yaaaaay i got it working smiley smiley smiley
Logged

Pages: [1] 2   Go Up
Jump to: