Go Down

Topic: problem displaying floating point number with 'LCD3wire' (Read 2437 times) previous topic - next topic

Hi everyone,
Thanks for your replies and input. 

I used float instead of int as I would wanted to make the most of the accuracy of the ds18b20.  For my project  1 degree (C )change  could make a difference.    I didn't realise it was so memory heavy!

This is going to sound crazy but I tried to find the source of the 3LCDwire library -  and I can't remember where I found it.   But I the code I started with was example  24.3 from here.
http://tronixstuff.wordpress.com/2011/01/08/tutorial-arduino-and-monochrome-lcds/

  the printIn ();   issue.    The code from the example above  uses PrintIn();  which was confusing for me as I was happily using println();  from the original liquidcrystal library.    I think this has been cleared up now.

Rather than dig myself deeper  into a problem I will try the fm's new-liquidcrystal library - 

I notice the shift registers used in the  '3 wire Shift register schematic'   the shift register is  74hc595n -  I am using  a ' 4094 8-bit Tri-state Shift Register Latch CMOS IC'   will  this work the same?  74hc595n?

  I will try and find some time to try it out tomorrow night and report back -  hopefully with success ;)

  Thanks again,
  Jim

floresta

Quote
I believe the original version of the LCD3wire (and LCD4Bit_mod library that I downloaded) used print to print a character array, and printIn to print an integer.

Why didn't you clarify the print IN versus print LN difference right after I brought it up in reply #4.

Don

floresta

Quote
This is not the case for a GLCD where all character values potentially have a glyph.
With the cp437 font you lose an inverted "cross" for <LF>  and 1/4 note musical symbol for <CR>

Could you get around this limitation by using some sort of 'escape' sequence the way they do with most serial backpack implementations for the character mode LCDs?

Don

bperrybap


Quote
This is not the case for a GLCD where all character values potentially have a glyph.
With the cp437 font you lose an inverted "cross" for <LF>  and 1/4 note musical symbol for <CR>

Could you get around this limitation by using some sort of 'escape' sequence the way they do with most serial backpack implementations for the character mode LCDs?

Don

Kind of. But in my view it would be a bit awkward.
With the glcd library there are better ways to handle it that i'm looking at going forward.
Since glcd supports text areas, and each text area has its own attribute modes,
I'll simply extend the modes to include wrapping options and a way to disable scrolling.
If you don't want wrapping or scrolling you can disable them and then every character prints.

In reality I don't think it is much of a problem as in over 2 years no one has complained about
not being able to print the glyphs under \r and \n.

--- bill

bperrybap


I notice the shift registers used in the  '3 wire Shift register schematic'   the shift register is  74hc595n -  I am using  a ' 4094 8-bit Tri-state Shift Register Latch CMOS IC'   will  this work the same?  74hc595n?


the 3 wire code in fm's library doesn't care what shift register part is used as long as it has
- clock
- data
- latch/strobe
input pins.

It also doesn't care which arduino pins control those 3 input pins or
which output bits on the SR are used for which lcd function.
All of that can be specified in the constructor so you can wire it up any way you want.
Just make sure to match the constructor to the way you have wired it up.
d,clk, and strb are arduino pin numbers
all the other parameters are shift register data bit numbers.

If you happened to have used this page as a wiring guide:
http://arduino.cc/playground/Code/LCD3wires

Then your 3wire constructor would be:

Code: [Select]

                 //     d,clk,strb, en,rw,rs,d4,d5,d6,d7
LiquidCrystal_SR3W lcd(11, 10, 12,  3, 2, 1, 7, 6, 5, 4);


While you can use any shift register, I've found that the 595's seem to be cheaper and easier to find.
You can get them in small quantities for 20 cents from these guys:
http://www.taydaelectronics.com/catalogsearch/result/?q=74hc595

--- bill




Hi All,
Just reporting back - 
I tried using FMs New LiquidCrystal library but struggled to find a 3wire example that I could mash into my project.  I say 'mash' because all of my projects are bits and pieces of examples that I play with until they work.       :smiley-red:

While trying to figure out NewLiquidCrystal I stumbled across ShiftRegLCD123 and thought I would give it a go.   It had everything I needed and was simple enough for me to understand :)  http://code.google.com/p/shiftreglcd123/

Thanks everyone.

bperrybap

I'd still recommend that you stick with fm's library.
You may experience an initial knowledge hump to get it installed and going but
then you won't later be the fighting functionality issues that existing in several
of these other libraries.
fm's library fully implements all the functions as documented in the LiquidCrystal
library that ships with the IDE.

I'm curious what kind of additional information/examples are you wanting?
Everything you need to get going is in reply #19.
There is a reference to a page that showed how to wire it up
(I provided a link to page with wiring for same 4094 that you were using)
There is the constructor to use for that wiring.
To install fm's library: (it is a replacement for the liquidcrystal library that ships with the IDE.
- move the existing LiquidCrystal library somewhere else (don't just rename it)
{Arduino-installdir}/libraries/LiquidCrystal
- download fm's library
- extract/install fm's library into {Arduino-installdir}/libraries/LiquidCrystal

Then you simply use the API as documented by the standard LiquidCrystal library:
http://arduino.cc/en/Reference/LiquidCrystal/

The only changes from any example you see there will be the constructor
needed to match your wiring that sets things up for the 3 wire SR register
vs the 4 bit mode.
So on this page of the LiquidCrystal documentation:
http://arduino.cc/en/Reference/LiquidCrystalConstructor
The LiquidCrystal library use a constructor named LiquidCrystal.
For the 3 wire SR mode, fm's library will use a constructor named LiquidCrystal_SR3W
and it uses different parameters.
If you wire up your 4094 like in the link provided in reply 19 you can use the constructor
provided in reply 19.

Hope that helps get you going.


--- bill




HI Bill,
I probably will persist with FM's library -  I do have an interest in using the most stable and most used library. And I'm not worried about a steep learning curve.  every step of this arduino process has  been a learning experience and it has been fun!    it was just after rewiring a perfectly good project just for a few extra pins which I don't really need I was getting frustrated and wanted something to work!
I have had another play with Fms library

after reinstalling Fm's library and trying out a simple sketch (below) I get the dreaded brown box with the following error.

liquidCrystal_SR3W does not name a type

Code: [Select]

#include <LiquidCrystal.h>

LiquidCrystal_SR3W lcd(8, 7, 9,  3, 2, 1, 7, 6, 5, 4);

void setup()
{
  lcd.print("hello, world!");
}

void loop() {}


cheers
Jim

bperrybap

Ok, I see the problem.
You are actually very close.

When using fm's library you use different include header files to specify the different sub device classes.

Code: [Select]
#include <LiquidCrystal.h>
Is for backward compatibility with the existing LiquidCrystal library and used for 4 bit mode.

Each sub device has its own header that is similar as its class name.

To specify/use the LiquidCrystal_SR3W sub device class use this include:
Code: [Select]
#include <LiquidCrystal_SR3W.h>

--- bill

#24
Jul 19, 2012, 01:15 pm Last Edit: Jul 19, 2012, 01:26 pm by watertrade Reason: 1
Thanks Bill  ( and those before )  :)




Go Up