Go Down

Topic: serLCD library on 1.0.3 with S.F. 16x2 serial LCD - no print function error (Read 1 time) previous topic - next topic


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: [Select]
  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.


i have the same problem
edit: i had the same problem, you should just include SoftwareSerial library


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.



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.



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'.  


Go Up