Pages: [1]   Go Down
Author Topic: Serial LCD on Uno demo problem, I2C/TWI serial LCD [SOLVED]  (Read 1614 times)
0 Members and 1 Guest are viewing this topic.
Illinois, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm trying to test a serial 20X4 LCD on an Uno, I just want to run 'Hello World', etc.

But I'm getting errors unclear to me:
HelloWorld:12: error: 'TKLCD_Local' does not name a type
HelloWorld.ino: In function 'void setup()':
HelloWorld:16: error: 'lcd' was not declared in this scope

Code:
/**
* Simple Hello World program. To be run on an Arduino connected
* to a TinkerKit LCD module via Serial.
*/

#include <Wire.h>
#include <LiquidCrystal.h>
#include <TKLCD.h>

//TKLCD_Serial lcd = TKLCD_Serial(); // when connecting to TKLCD over Serial
TKLCD_Local lcd = TKLCD_Local(); // when programming a TKLCD module itself

void setup() {
  lcd.begin();
   lcd.clear();
   lcd.print("Hello World!");
}
void loop() {
  ; // nothing do be done
}

I have added the TKLCD library.

Any suggestions appreciated.
« Last Edit: February 25, 2013, 11:46:58 am by Ashton » Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8084
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you also get an error saying that the file TKLCD.h was not found?  Did you remember to re-start the Arduino IDE after putting the TKLCD library in place?
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Illinois, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes I restarted it.

I do not get an error stating the TKLCD was not found.  Just the 3 above errors.

This is strange, when I go to Sketch, Import Library, select TKLCD, it Does Not place the '#include <TKLCD.h>' line in the code for me.
Should it?  I have manually entered it.

Here is another, why are the 'Wire' and 'LiquidCrystal' library names in Red, but the 'TKLCD' library name is black?
Does this indicate anything?
« Last Edit: February 23, 2013, 04:24:14 pm by Ashton » Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8084
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You use TKLCD_Local only when you are using the TinkerKit LCD as if it were an Arduino Leonardo.  If you connect it to an Arduino UNO you use TKLCD_Serial.

http://www.tinkerkit.com/lcd/
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Illinois, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok

I selected the TKLCD_Serial lcd = TKLCD_Serial(); and commented the Local.
Same errors.  I think there is a clue with the library not displaying when added, or in red.

Can a Library have old version references, that are not acceptable to the UNO R3 firmware?

TKLCD Library location:
http://www.tinkerkit.com/tklcd-library/#tklcd_serial

Hello world demo sketch:
http://www.tinkerkit.com/lcd-arduino-two-wires-tutorial/
« Last Edit: February 23, 2013, 05:12:49 pm by Ashton » Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8084
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


I downloaded the library .zip file, expanded the .zip file in the libraries folder, re-started the Arduino IDE, and copied and pasted the demo sketch.  It compiled just without errors.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Illinois, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for your time John.

I'll start over from scratch, retest, and report back.
Logged

Illinois, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks

The sketch compiles without errors after reinstalling the TKLCD library.

Now I just need to determine why the serial LCD displays I have (with terminals GND, VCC, SDA, SCL) are not displaying the serial output of the UNO board when tested.  LCD display under test -> http://www.ebay.com/itm/200764158676
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8084
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Now I just need to determine why the serial LCD displays I have (with terminals GND, VCC, SDA, SCL) are not displaying the serial output of the UNO board when tested.  LCD display under test -> http://www.ebay.com/itm/200764158676

That's an I2C/TWI serial LCD.  The TinkerKit library is for an LCD connected through the serial port.  You will need to download a matching I2C LCD library.  The PCF8574T chip on the board connected to the LCD is an I2C 8-bit I/O expander.  The library you want is probably "LiquidCrystal_I2C.zip":

http://hmario.home.xs4all.nl/arduino/LiquidCrystal_I2C/
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Illinois, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I had been testing a sketch using the LiquidCrystal_I2C library with no success.  Also another for the I2C LCD found here: http://www.strangeparty.com/2011/01/17/arduino-talking-to-an-i2c-lcd-display/ this supposedly displays any character keyed into Hyperterminal -- but nothing working.

I'm not sure where to go from here.  I feel like I did when trying to date a cheerleader.
Logged

Illinois, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm now testing using the below code, with a different library and IT WORKS!!!!
Code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

//Addr: 0x3F, 20 chars & 4 lines
LiquidCrystal_I2C lcd(0x27,20,4);  //(0x3F,20,4) Didn't work!

void setup()
{
    lcd.init();
    lcd.backlight();
    lcd.setCursor(0, 0);
    lcd.print("Hello");
}
void loop()
{

}

All ok, no errors.

Code source:
http://bradsduino.blogspot.com/2012/10/sainsmart-iici2ctwi-serial-2004-20x4.html?showComment=1361809219336#c7382264317681315704
Using library:
https://arduino-info.wikispaces.com/file/detail/LiquidCrystal_I2C2004V1.zip

Thanks
« Last Edit: February 25, 2013, 11:34:37 am by Ashton » Logged

Pages: [1]   Go Up
Jump to: