Pages: 1 ... 4 5 [6] 7 8 ... 10   Go Down
Author Topic: New LiquidCrystal library - LCD library  (Read 24698 times)
0 Members and 2 Guests are viewing this topic.
Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What I posted (the masks) made it very obvious it just lacked your supercilious jargon requirement.

What I had to put up with for someone attempting to contribute something useful is quite frankly disgraceful. A good lesson for others I think.

As for negative logic control, with the current methods it is possible but on the code it will look strange: setBackligh (LOW) -> will change to 0, will switch on
Hence my post.

To someone who has such a device in their parts box they will have to change their code (rather than their initialisation) in order to switch displays.

I thought that such a suggestion would enable this library to comply better with this goal
  • Your projects can swap in and out LCDs that use an IO expander board, you are not constraint by library availability with different APIs.
I thought wrong.

I will depart and our friend Bill can live with his smug superiority.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Francisco
Thanks very much for your hard work and this awesome library!  I successfully got it working with a Shift Register in 2 and 3 wire mode (totally awesome).  I've read back through this post a bit and it seems that you have implemented some backlight control for the i2c expander.  Is this possible with the _SR class?  The schematics posted in the hardware section don't show which pin of the Shift Register to control the backlight. 

Ok, i just had a sneak peak at your RC5 and it looks like you're working on the documentation as we speak, so I'll wait for that.
Thanks again!
Logged

Málaga, Spain
Offline Offline
Edison Member
*
Karma: 41
Posts: 2182
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You are very welcome, and I am glad that you liked it.

It is not only me working on the library, there has also been the invaluable contribution of bperrybap whose made a significant contribution speeding the library even further, reviewing making suggestions since it started and picasso who was the original tester of the SR library and wrote the fastIO routines.

As for backlight control, it will be added shortly in the schematic section for those LCD drivers  that support it. It is still under development and new drivers will be added in the future. I also want to rework a bit the wiki to make it easier to identify what schematic to use for each class and how to create the associated lcd object.

Thanks again for using it and enjoy it.
Logged

   

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Bill! Thanks picasso! Superb work.
Logged

Dublin, Ireland
Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Real nice job... my thanks to everyone involved...

Just in case I got it wrong, I best ask... what's the procedure for adding the new version of the library...









Logged

Málaga, Spain
Offline Offline
Edison Member
*
Karma: 41
Posts: 2182
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@MikeOTool, simply copy the contents of the zip file into the LiquidCrystal library folder of the Arduino IDE. It would be good to copy the LiquidCrystal original files somewhere else for safe keeping and fallback if you need it.

Cheers and enjoy it.
Logged

   

Dublin, Ireland
Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, taught as much so that's what I did...

Running the test code resulted in two errors ('class LiquidCrystal' has no member named 'setBacklightPin' and 'class LiquidCrystal' has no member named 'setBacklight') so I posted the above...

To continue testing, I commented these out and everything worked fine... now I juts need to fix these...
Mike
Logged

Málaga, Spain
Offline Offline
Edison Member
*
Karma: 41
Posts: 2182
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ummm, I'll review the code, but I am fairly sure that the librarwy does support it.

There is one thing that comes to mind, have you removed the old LiquidCrystal library?
« Last Edit: April 03, 2012, 04:28:06 pm by fm » Logged

   

Málaga, Spain
Offline Offline
Edison Member
*
Karma: 41
Posts: 2182
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've been looking at the source under rel 1.2.1 and those methods are there, both in the header file and in the c file. So, there are two options, the old LiquidCrystal header file is still there or the zip file of version 1.2.0 in the download section is not correct.

Do let me know to see if I have to fix it, but no one else has raise the problem.
Logged

   

Dublin, Ireland
Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for that... no problem it should be a breeze to fix... (seems I said that a little quickly smiley-wink)

Update...
Assuming it was still loading the old header files (even though I had renamed the folder), I decided to remove it completely and of course it was...
When I tried to compile it reported it could not find the header file... I closed the Arduino console and restarted it... loaded the test code and it compiled perfectly....

The example files work now but the code I was working on (MyHelloWorld_4bit.ino) appears to have been turned into a binary file...
Is it possible the Arduino console compiled MyHelloWorld_4bit.ino and saved it overwriting my file?
Mike
« Last Edit: April 03, 2012, 06:26:48 pm by MikeOToole » Logged

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

Thanks fm, bperrybap and others for developing this library.

I've installed it and in preparation to begin working my way through its capabilities I tested my IDE 1.0 installation of the new Library with a number of the original LiquidCrystal examples. All worked fine until I struck an odd overload compile error with the Custom Characters sketch.

Code:
/*
  LiquidCrystal Library - Custom Characters
 
 Demonstrates how to add custom characters on an LCD  display. 
 The LiquidCrystal library works with all LCD displays that are
 compatible with the  Hitachi HD44780 driver. There are many of
 them out there, and you can usually tell them by the 16-pin interface.
 
 This sketch prints "I <heart> Arduino!" and a little dancing man
 to the LCD.
 
  The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * 10K potentiometer:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)
 * 10K poterntiometer on pin A0
 
 created21 Mar 2011
 by Tom Igoe
 Based on Adafruit's example at
 https://github.com/adafruit/SPI_VFD/blob/master/examples/createChar/createChar.pde
 
 This example code is in the public domain.
 http://www.arduino.cc/en/Tutorial/LiquidCrystal
 
 Also useful:
 http://icontexto.com/charactercreator/
 
 */

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

// make some custom characters:
byte heart[8] = {
  0b00000,
  0b01010,
  0b11111,
  0b11111,
  0b11111,
  0b01110,
  0b00100,
  0b00000
};

byte smiley[8] = {
  0b00000,
  0b00000,
  0b01010,
  0b00000,
  0b00000,
  0b10001,
  0b01110,
  0b00000
};

byte frownie[8] = {
  0b00000,
  0b00000,
  0b01010,
  0b00000,
  0b00000,
  0b00000,
  0b01110,
  0b10001
};

byte armsDown[8] = {
  0b00100,
  0b01010,
  0b00100,
  0b00100,
  0b01110,
  0b10101,
  0b00100,
  0b01010
};

byte armsUp[8] = {
  0b00100,
  0b01010,
  0b00100,
  0b10101,
  0b01110,
  0b00100,
  0b00100,
  0b01010
};
void setup() {
  // create a new character
  lcd.createChar(0, heart);
  // create a new character
  lcd.createChar(1, smiley);
  // create a new character
  lcd.createChar(2, frownie);
  // create a new character
  lcd.createChar(3, armsDown); 
  // create a new character
  lcd.createChar(4, armsUp); 

  // set up the lcd's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the lcd.
  lcd.print("I ");
  lcd.write(0);
  lcd.print(" Arduino! ");
  lcd.write(1);

}

void loop() {
  // set the cursor to the bottom row, 5th position:
  lcd.setCursor(4, 1);
  // draw the little man, arms down:
  lcd.write(3);
  delay(500);
  lcd.setCursor(4, 1);
  // draw him arms up:
  lcd.write(4);
  delay(500);
}

I get the following compile error which I do not have the Arduino knowledge to resolve:
Quote
CustomCharacter.cpp: In function 'void setup()':
CustomCharacter:114: error: call of overloaded 'write(int)' is ambiguous
/Applications/Arduino.app/Contents/Resources/Java/libraries/LiquidCrystal/LCD.h:479: note: candidates are: virtual size_t LCD::write(uint8_t)
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Print.h:49: note:                 size_t Print::write(const char*)
Logged

Málaga, Spain
Offline Offline
Edison Member
*
Karma: 41
Posts: 2182
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Umm, everything is possible with SW, but that is a bit odd.
Logged

   

Málaga, Spain
Offline Offline
Edison Member
*
Karma: 41
Posts: 2182
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@dweston -  did you remove the old library, not just moving it somewhere else. There is an example in the New LiquidCrystal library that uses the creation of custom characters, helloworld_4bit. Give that a shot.
Logged

   

Málaga, Spain
Offline Offline
Edison Member
*
Karma: 41
Posts: 2182
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@dweston - the other thing you can do is to change the byte declaration of the character creation variable by int8_t. This should fix it by not having ambiguities in the call.
Logged

   

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

@fm I followed your advice at Reply #80 "simply copy the contents of the zip file into the LiquidCrystal library folder of the Arduino IDE." The library folder I presumed you mean is the one within the Arduino.app contents package (I'm using MacOSX) i.e. [/Applications/Arduino.app/Contents/Resources/Java/libraries/LiquidCrystal/].

Pardon the embarrassment of my naivety but I don't know how to apply your suggested "change the byte declaration of the character creation variable by int8_t"?

The example "helloworld_4bit" works fine, although I noted a spelling error in line 8:
Quote
LiquidCrystal lcd(8, 9, 4, 5, 6, 7, BACKLIGH_PIN, POSITIVE );

should read:
Quote
LiquidCrystal lcd(8, 9, 4, 5, 6, 7, BACKLIGHT_PIN, POSITIVE );

The pin number changes reflect the DFRobot-007 LCD Keypad shield I'm using.
Logged

Pages: 1 ... 4 5 [6] 7 8 ... 10   Go Up
Jump to: