SPI liquidCrystal Library for HD44780 based displays

i'm trying to use the SPI port to control a HD44780 Character based LCD.

Followed this tutorial Arduino Playground - LiquidCrystal Library and could not get it to work.

The errors below are shown.

HelloWorld_SPI:47: error: no matching function for call to 'LiquidCrystal::LiquidCrystal(int)'
C:\Users\CS\Documents\Arduino\libraries\LiquidCrystal/LiquidCrystal.h:86: note: candidates are: LiquidCrystal::LiquidCrystal(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, t_backlighPol)
C:\Users\CS\Documents\Arduino\libraries\LiquidCrystal/LiquidCrystal.h:83: note:                 LiquidCrystal::LiquidCrystal(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, t_backlighPol)
C:\Users\CS\Documents\Arduino\libraries\LiquidCrystal/LiquidCrystal.h:78: note:                 LiquidCrystal::LiquidCrystal(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)
C:\Users\CS\Documents\Arduino\libraries\LiquidCrystal/LiquidCrystal.h:76: note:                 LiquidCrystal::LiquidCrystal(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)
C:\Users\CS\Documents\Arduino\libraries\LiquidCrystal/LiquidCrystal.h:68: note:                 LiquidCrystal::LiquidCrystal(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, t_backlighPol)
C:\Users\CS\Documents\Arduino\libraries\LiquidCrystal/LiquidCrystal.h:64: note:                 LiquidCrystal::LiquidCrystal(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, t_backlighPol)
C:\Users\CS\Documents\Arduino\libraries\LiquidCrystal/LiquidCrystal.h:58: note:                 LiquidCrystal::LiquidCrystal(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)
C:\Users\CS\Documents\Arduino\libraries\LiquidCrystal/LiquidCrystal.h:55: note:                 LiquidCrystal::LiquidCrystal(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)
C:\Users\CS\Documents\Arduino\libraries\LiquidCrystal/LiquidCrystal.h:45: note:                 LiquidCrystal::LiquidCrystal(const LiquidCrystal&)

Does anyone have any ideas or knows of a similar library I could use?

You don't provide your sketch, so it's a bit of a challenge to guess where the problem might be. If you'd like help on this, please post a sketch that illustrates the problem. It would be best if you could post a minimal sketch that illustrates the problem, rather than a long and complicated sketch. You'll get more responses, and better ones, if your sketch is short and straightforward.

While you're at it, please give us a description of how you installed the modified LiquidCrystal library from the playground page.

I didn't modify it. As per instructions I deleted the original LiquidCrystal folder and replaced it with the one on the download page, for version 1 and above.

I tried on V1.05 and V1.06

The SPI example sketch can be found on the examples.

#include <SPI.h>
 
//some comments missing here but they will be in the original sketch
 
// include the library code:
#include <LiquidCrystal.h>
 
// initialize the library with the number of the sspin
//(or the latch pin of the 74HC595)
LiquidCrystal lcd(10);
 
void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(20, 4);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}
 
void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
}

There are few versions of LiquidCrystal "library" and SPI is TWO wire interface, hence specifying ONE pin will require some other "magic" or correct class / correct constructor to make it play.

Forget Arduino stuff and check out Github LiquidCrystalI2C files. Study both header and cpp files, they are well commented and with sample code.
Download the I2C files.

Than initialize your LCD class using correct constructor ( two pins ).
SPI /I2C /TWI are all describing SAME two wire interface.
Make sure your SPI / TWI ports have pull-ups if the are open collector ports.

Just to be sure - your LCD HAS SPI / TWI interface , yes?

PS Just noticed this gem - so you MAY be OK using exiting library, but different constructor.

// initialize the library with the number of the sspin BS!
//(or the latch pin of the 74HC595)
LiquidCrystal lcd(10);

My best guess is - the pin 10 is "shield selector" and you need to ADD SPI pins (true LCD pins) if you are really using LCD shield - to the constructor.
I would still read thru the "library" source files.

casemod:
I didn't modify it. As per instructions I deleted the original LiquidCrystal folder and replaced it with the one on the download page, for version 1 and above.

I can only recommend that you check it, to verify that you're actually working with the replacement library. When I try to compile your sketch with the original LiquidCrystal library that came with the IDE, I get error messages that start with this:

sketch_dec22a:10: error: no matching function for call to 'LiquidCrystal::LiquidCrystal(int)'

and, from a cursory examination, look like the error messages that you quote in the original post.

When I delete that original LiquidCrystal folder from \libraries, and replace it with the folder found in the file "LiquidCrystal_1.zip" from the playground page, the code complies handily, with a few warnings. Used Windows 7, and IDE 1.05.

I think that the original library somehow persists. For a quick check, this line -#include <SPI.h>is the fifth non-blank line in the replacement library; it doesn't appear in the original library.

Vaclav, Two Wire and Serial Peripheral Interface are well different from each other :wink:

Thanks tmd3 , just figured that out, while writing my own library.
I was changing the cpp to write directly to the AVR registers and nothing!

Apparently even tough I deleted the folder, the Arduino was reading some library folder on a different directory. Plain ridiculous why a new install of the 1.06 with its own folders would link to some previous installed directory!!!!

In the end had to use windows search and remove all the previous folders for it to start looking on the correct place...

Plain ridiculous IDE... I tough it was ridiculous that when one renamed a folder it would still read it, rather than the one with the correct name, but never come to mind it had a will of its own to read the directory from a different installation... I mean how do they code this!!??

Hope it helps other with similar issues.

casemod:
Apparently even tough I deleted the folder, the Arduino was reading some library folder on a different directory. Plain ridiculous why a new install of the 1.06 with its own folders would link to some previous installed directory!!!!

I can't say. It didn't do anything interesting for me. I copied the entire 1.05 folder, then replaced and replaced the \libraries\LiquidCrystal folder with the one I found in the zipfile on the playground page. It worked without incident.