LCD3wire solution for Attiny85

Forgive my ignorance, but I am trying to lighten a library so that I can fit it onto an Attiny85.

I am trying to employ LCD3wire (new liquid crystal library) using LiquidCrystal_SR -- so the Attiny is coupled with a 74HC595 shift register. The trouble is, the LiquidCrystal_SR (shift register) portion is already upwards of 6000 bytes by itself when compiled. I'm also running into issues compiling for the Attiny85, but perhaps I'll leave that for another thread.

I instead tried to use the LiquidCrystal595 library which is much lighter (2000 bytes). Unfortunately I wasn't able to get my hardware working with this code using an HH4870 16x 2 LCD with a Leonardo board. I spent a good part of my night trying to figure that out, but as far as I could tell, I had everything wired correctly, and only got gibberish on the display.

Thus, I'm reluctantly turning here for help. I don't absolutely have to use an Attiny85 for this project, but I would like to if possible.

Thank you.

When using fm’s library, make sure you are not including the Wire library by accident.
That will add quite a bit of unused code.
If <Wire.h> is included in your sketch it will drag in the Wire library.
When I build a small “helloWorld” sketch using fm’s library for an UNO I get around a 3k image
but when the same sketch is built for Leonardo it is 6834 bytes.
The code for fm’s library when using the SR interface
is from 0x186 to 0x5e2 in my image or 0x45c bytes or only 1116 bytes.
All the other code up to 3k on uno or 6.8k on Leonardo is all other arduino stuff.
(Leonard has a lot of code for the virtual USB serial interface)

With your other library, the problem is likely to be that your hardware doesn’t match
up with wiring that library is using.
Verify that you have wired up the SR output pins/bits to the same LCD connections
that the library is expecting.

— bill

HelloWorld2_SR.cpp.lss (71.3 KB)

Thanks Bill.

How do I prevent the fm's library from pulling in the Wire library though? It seems to need it through the I2CIO module:

C:\Users\Bryan\Documents\Arduino\libraries\LiquidCrystal\I2CIO.cpp: In member function 'int I2CIO::begin(uint8_t)':
C:\Users\Bryan\Documents\Arduino\libraries\LiquidCrystal\I2CIO.cpp:61: error: 'Wire' was not declared in this scope
C:\Users\Bryan\Documents\Arduino\libraries\LiquidCrystal\I2CIO.cpp: In member function 'uint8_t I2CIO::read()':
C:\Users\Bryan\Documents\Arduino\libraries\LiquidCrystal\I2CIO.cpp:117: error: 'Wire' was not declared in this scope
C:\Users\Bryan\Documents\Arduino\libraries\LiquidCrystal\I2CIO.cpp: In member function 'int I2CIO::write(uint8_t)':
C:\Users\Bryan\Documents\Arduino\libraries\LiquidCrystal\I2CIO.cpp:140: error: 'Wire' was not declared in this scope

Which is what I get if I don't include Wire.h with LiquidCrystal and invoke LiquidCrystal_SR() with 3 wires.

Which is what I get if I don’t include Wire.h with LiquidCrystal

I don’t understand this.
The sketch should only include <LiquidCrystal_SR.h>

I2CIO does need the Wire.h header to compile but it should find it on its own as long
as fm’s library replaced the LiquidCrystal library that came with the IDE.
(you can’t put it in your own sketchbook libraries)
But as long as you don’t include <Wire.h> in your sketch the IDE won’t link in
the Wire library.

Also, fm’s current version will not work with IDE 1.5x so it has to be the
older 1.x IDE.

If you are still having issues, can you turn on the verbose mode and past
the errors here so I can take a look?

— bill