GithubHelp home page GithubHelp logo

mathertel / liquidcrystal_pcf8574 Goto Github PK

View Code? Open in Web Editor NEW
127.0 127.0 54.0 52 KB

A library for driving LiquidCrystal displays (LCD) by using the I2C bus and an PCF8574 I2C adapter.

Home Page: https://www.mathertel.de/Arduino/LiquidCrystal_PCF8574.aspx

License: BSD 3-Clause "New" or "Revised" License

C++ 100.00%
arduino arduino-library lcd liquidcrystal pcf8574

liquidcrystal_pcf8574's Introduction

liquidcrystal_pcf8574's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

liquidcrystal_pcf8574's Issues

Effects not working with text longer that 16 char

/*
This code is not working, the line with effects overlaps at the begining of the line replicating one char
If I change the line fx.applyEffect(text, 11, 18, effect::invert); to fx.applyEffect(text, 11, 15, effect::invert); // bold "Hello"
it does not apply the desired effect but do not overlap

Did I make any mistake ?
*/

#include <Arduino.h>

#include <Wire.h>
#include <LiquidCrystal_PCF8574.h> // should work with any LCD library
LiquidCrystal_PCF8574 lcd(0x27);

void make_char(char c, uint8_t* image){ //need this function to pass to LcdEffects
lcd.createChar(c, image); // so it knows how to make custom characters
}

#include <LcdEffects.h> // the core library
#include <Effects.h> // a collection of common effects
LcdEffects<> fx(make_char); // initialize the LcdEffects library

void setup() {
lcd.begin(20, 4); //change to match the size of your LCD
lcd.setBacklight(255);
}
void loop() {
char text[] = "12345678901234567890"; // puts the text in an array so we can work with it
lcd.setCursor(0,0);
lcd.print(text); //print the text to the first line without any effects (for comparison)

fx.applyEffect(text, 0, 5, effect::invert);
fx.applyEffect(text, 7, 10, effect::bold);
fx.applyEffect(text, 11, 18, effect::invert);

lcd.setCursor(0,1); //now print the text to the second line
lcd.print(text);

delay(1000);
}

Individual files can't be changed from LGPL to dual license with BSD

Since you don't fully own the copyrights to the original work there are licensing restrictions on the files and the combined work.

LGPL does allow the linking of LGPL files with more files that use lax licenses such as BSD; however, there are some incompatibilities so you can't use a dual license of LGPL and BSD on a single file.

i.e. LGPL is not as permissive as BSD and you can't convert LGPL licensed s/w to BSD even if you modify it into a derivative work.
Read section 2 of the LGPL license specifically 2c
i.e. the code started as LGPL 2.1+ , any modifications and updates to that code must be licensed LGPL 2.1+

Also, when you link BSD and LGPL licensed works together, the combined work inherits the requirements of LGPL so the more relaxed licensing of BSD is lost.

i.e. if you have a work that contains separate modules some BSD and some LGPL any work that uses them both would be subject to LGPL.

This library started with LGPL 2.1+ code so it isn't possible to modify the code to make it BSD.

Licensing terms

If the code is a derivative of the Arduino LiquidCrystal code (as indicated by the comments in the code) any license used for this project must be compatible with the LiquidCystal license which is LGPL 2.1+
LGPL 2.1+ licensed code can not be changed to a more permissive license such as BSD or MIT.
It would have to remain LGPL 2.1+

Backlight brightness does not work as expected

Seems that void LiquidCrystal_PCF8574::setBacklight(uint8_t brightness) does not work as expected and at least on my display it is merely on or off. Passing 0 toggless the backlight off and any positive value toggless it fully on.

Might be that it works on some other boards though.

No default constructor for common PCF8574 LCD address 0x27

Hi
Many of the PCF8574 LCDs (all of mine) use address 0x27 and this is the example value in the .h file.
Suggestion: Provide a default constructor value to allow easy compatibility/min code change when changing LCD type in an existing project.

Best regards
Rob

LCD Write Odd Wrapping

Hi. Odd behaviour when writing long strings to a 20 × 4 display.

Starting with the cursor at 0, 0. When a string exceeds 20 characters, the balance of the string wraps to the third line of the display. If the string exceeds 40 characters, the balance wraps to the second line. If the string exceeds 60 characters, it wraps to the fourth line.

So the writing wrapping order is:
Line 1
Line 3
Line 2
Line 4.

For example, using a "serial echo" sketch, send the string:

1-abcdefghijklmnopqX2-abcdefghijklmnopqX3-abcdefghijklmnopqX4-abcdefghijklmnopqX

It shows up on the display as:

1-abcdefghijklmnopqX
3-abcdefghijklmnopqX
2-abcdefghijklmnopqX
4-abcdefghijklmnopqX

Demo sketch attached
LCD_SerialDisplay2.ino.zip
.

Non asci characters

Thanks for a great library! It was the only one which worked with my display.
I want to display characters with umlauts which are not in the asci character set. Do you know how to do that?
Example:
lcd.print("ä ö");

LCD 16x4 behaves strange.

How to go about with a 16x4 display ? pos (0,2) and (0,3) starts on position (4,2) and (4,3).

Here is the code:
lcd.clear(); lcd.setCursor(0, 0); lcd.print("*** first line."); lcd.setCursor(0, 1); lcd.print("*** second line."); lcd.setCursor(0, 2); lcd.print("*** third line."); lcd.setCursor(0, 3); lcd.print("*** fourth line.");

Scherm­afbeelding 2023-12-06 om 17 21 10

LCD show ramdom caracteres after a while

hello very good library. i am new to arduino but

I would like to know if there is any reason why the LCD screen shows random characters after a while.

eg bad settings ?, noise ?, is it a common feature on LCD? does the library have any functions that allow me to take control of the lcd again?

Thank you.

Compactible With PCA8574?

I have tested with Arduino Nano Every with I2CLCD 16x2 and I2CLCD 20x4 with PCA8574 I2C expander. Both failed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.