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.
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.
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.
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_(SKU:_DFR0063)
that code i tried too.
Lot of the code i also tried was from the examples everywhere in the IDE libraries...
//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
Once you have noted the address it give you, high probably not 27, correct the address in this code upload it and try it
/*
** 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);
}
/* YourDuino.com Example Software Sketch
16 character 2 line I2C Display
Backpack Interface labelled "YwRobot Arduino LCM1602 IIC V1"
terry@yourduino.com */
/*-----( Import needed libraries )-----*/
#include <Wire.h> // Comes with Arduino IDE
// Get the LCD I2C Library here:
// https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
// Move any other LCD libraries to another folder or delete them
// See Library "Docs" folder for possible commands etc.
#include <LiquidCrystal_I2C.h>
/*-----( Declare Constants )-----*/
/*-----( Declare objects )-----*/
// set the LCD address to 0x27 for a 20 chars 4 line display
// Set the pins on the I2C chip used for LCD connections:
// addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address
/*-----( Declare Variables )-----*/
//NONE
void setup() /*----( SETUP: RUNS ONCE )----*/
{
Serial.begin(9600); // Used to type in characters
lcd.begin(16,2); // initialize the lcd for 16 chars 2 lines, turn on backlight
// ------- Quick 3 blinks of backlight -------------
for(int i = 0; i< 3; i++)
{
lcd.backlight();
delay(250);
lcd.noBacklight();
delay(250);
}
lcd.backlight(); // finish with backlight on
//-------- Write characters on the display ------------------
// NOTE: Cursor Position: (CHAR, LINE) start at 0
lcd.setCursor(0,0); //Start at character 4 on line 0
lcd.print("Hello, world!");
delay(1000);
lcd.setCursor(0,1);
lcd.print("HI!YourDuino.com");
delay(8000);
// Wait and then tell user they can start the Serial Monitor and type in characters to
// Display. (Set Serial Monitor option to "No Line Ending")
lcd.clear();
lcd.setCursor(0,0); //Start at character 0 on line 0
lcd.print("Use Serial Mon");
lcd.setCursor(0,1);
lcd.print("Type to display");
}/*--(end setup )---*/
void loop() /*----( LOOP: RUNS CONSTANTLY )----*/
{
{
// when characters arrive over the serial port...
if (Serial.available()) {
// wait a bit for the entire message to arrive
delay(100);
// clear the screen
lcd.clear();
// read all the available characters
while (Serial.available() > 0) {
// display each character to the LCD
lcd.write(Serial.read());
}
}
}
}/* --(end main loop )-- */
/* ( THE END ) */
works.
i thnk where i went wrong, was this code references LiquidCrystal_I2C.h
and i never tried that with the updated v1.2.1 LiquidCrystal library, assuming that that library wasnt I2C because name never specified.
Other thing i learned searching this morning is, i think the IDE (v1.5.3), (and hopefully the screen), will support Extended chars, but the Serial Monitor in the IDE does NOT support them...
In case anybody else is interested.