Loading...
Pages: [1]   Go Down
Author Topic: serLCD library on 1.0.3 with S.F. 16x2 serial LCD - no print function error  (Read 308 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm fairly new at this.  I have an Arduino Uno version 2. I'm trying to get a SparkFun serial backpack 16x2 LCD display to work. I placed the 2 files ( serLCD.cpp and serLCD.h)  in directory "serLCD" in the libraries directory.  I then copied the example for print function:

Code:
/*
  serLCD - Hello World Example
*/
#include <serLCD.h>
#include <NewSoftSerial.h>

 
// Set pin to the LCD's rxPin
int pin = 2;
 
serLCD lcd(pin);
 
void setup()
{
  lcd.print("hello, world!");
}
 
void loop() {}

The lcd is hooked to pin 2 to match the example. When I compile I get

'class serLCD' has no member named 'print'

Indeed, I see no print function in serLCD.cpp.  This is a very simple piece of code and I don't understand what's wrong.
Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 83
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i have the same problem
edit: i had the same problem, you should just include SoftwareSerial library
« Last Edit: February 28, 2013, 04:19:34 pm by aureliusss » Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 17
Posts: 3465
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I placed the 2 files ( serLCD.cpp and serLCD.h)  in directory "serLCD" in the libraries directory.

Did you exit and restart the Arduino IDE after you installed the library?

Which 'libraries' directory did you put them in?

There is one 'libraries' directory somewhere within the Arduino IDE program folder and there is another somewhere in your own 'documents' area.  While either should work you are better off using the second location.

If you look in that second location you will find a readme.txt file which points you to --> http://arduino.cc/en/Guide/Libraries".  Among other things that file tells you where to put the library files.  In other words, once you find the recommended location to install your library you will find the instructions on how to find that location.  I wish I had thought of that.


Don
Logged

Pages: [1]   Go Up
Print
 
Jump to: