Pages: [1]   Go Down
Author Topic: serLCD library on 1.0.3 with S.F. 16x2 serial LCD - no print function error  (Read 738 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
Full Member
***
Karma: 1
Posts: 160
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: 25
Posts: 4108
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

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow, the library names misled me, I assumed that NewSoftSerial was the "new" serial library that would have been included with the current distribution of the IDE [Integrated Development Environment] , turns out that "SoftwareSerial" is the NEW version of "NewSoftSerial" and must be included (replace the call for the library in the old example I am using to redo the spark fun serial LCD splash screen.

if you open software serial.cpp in a text editor it says:
"SoftwareSerial.cpp (formerly NewSoftSerial.cpp)"
so the include statement in the example does not define lcd.print in the splash screen code when used on the current version of the IDE.
Using 1.0.5 I needed to change "#include <NewSoftSerial.h>" to "#include <SoftwareSerial.h>

I'm still confused by all this so I apologize if I confused you even more.
as I was getting errors on lcd.print and even serLCD vefore that.

-Mark
Logged

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

Quote
Wow, the library names misled me, ...

I don't understand what is wrong with using 'libraryname vXX'.  I'm looking forward to finding out what they call the next version of the 'newlibrary'.  

Don
Logged

Pages: [1]   Go Up
Jump to: