Skip to content

Commit 5567e1d

Browse files
authored
Merge branch 'mathertel:master' into master
2 parents db08789 + d628d76 commit 5567e1d

File tree

8 files changed

+324
-92
lines changed

8 files changed

+324
-92
lines changed

.github/workflows/arduino-checks.yml

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# This is a basic workflow to help you get started with Actions for Arduino library projects
2+
3+
name: Arduino Library Checks
4+
5+
# Controls when the action will run.
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the develop branch
8+
push:
9+
branches: [master]
10+
pull_request:
11+
branches: [master]
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
jobs:
17+
18+
# This defines a job for checking the Arduino library format specifications
19+
# see <https://github.com/marketplace/actions/arduino-arduino-lint-action>
20+
21+
lint:
22+
name: check library format
23+
runs-on: ubuntu-latest
24+
continue-on-error: true
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
29+
# Arduino - lint
30+
- name: Arduino-lint
31+
uses: arduino/arduino-lint-action@v1
32+
with:
33+
library-manager: update
34+
verbose: false
35+
36+
# These jobs are used to compile the examples fot the specific processor/board.
37+
# see <https://github.com/marketplace/actions/compile-arduino-sketches>
38+
39+
compile-uno:
40+
name: compile uno examples
41+
runs-on: ubuntu-latest
42+
continue-on-error: true
43+
44+
steps:
45+
- uses: actions/checkout@v2
46+
47+
# Compile Examples for UNO
48+
- name: Compile examples for UNO
49+
uses: arduino/compile-sketches@v1
50+
with:
51+
verbose: true
52+
fqbn: arduino:avr:uno
53+
sketch-paths: |
54+
- 'examples/LiquidCrystal_PCF8574_Test'
55+
56+
compile-esp8266:
57+
name: compile esp8266 examples
58+
runs-on: ubuntu-latest
59+
continue-on-error: true
60+
61+
steps:
62+
- uses: actions/checkout@v2
63+
64+
# Compile Examples for ESP8266
65+
- name: Compile examples for ESP8266
66+
uses: arduino/compile-sketches@v1
67+
with:
68+
verbose: true
69+
platforms: |
70+
# Install ESP8266 platform via Boards Manager
71+
- name: esp8266:esp8266
72+
source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json
73+
version: 3.0.0
74+
fqbn: esp8266:esp8266:nodemcuv2
75+
sketch-paths: |
76+
- 'examples/LiquidCrystal_PCF8574_Test'
77+
78+
compile-esp32:
79+
name: compile ESP32 examples
80+
runs-on: ubuntu-latest
81+
continue-on-error: true
82+
83+
steps:
84+
- uses: actions/checkout@v2
85+
86+
# Compile Examples for ESP32
87+
- name: Compile examples for ESP32
88+
uses: arduino/compile-sketches@v1
89+
with:
90+
verbose: true
91+
# Install ESP32 platform via Boards Manager
92+
platforms: |
93+
- name: "esp32:esp32"
94+
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
95+
version: 2.0.3
96+
fqbn: esp32:esp32:esp32
97+
sketch-paths: |
98+
- 'examples/LiquidCrystal_PCF8574_Test'

LICENSE

+23-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
1-
Software License Agreement (BSD License)
1+
BSD 3-Clause License
22

3-
Copyright (c) 2005-2016 by Matthias Hertel, http://www.mathertel.de/
3+
Copyright (c) 2005-2020, Matthias Hertel, http://www.mathertel.de/
44

55
All rights reserved.
66

7-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7+
Redistribution and use in source and binary forms, with or without
8+
modification, are permitted provided that the following conditions are met:
89

9-
•Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
10-
•Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
11-
•Neither the name of the copyright owners nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
1. Redistributions of source code must retain the above copyright notice, this
11+
list of conditions and the following disclaimer.
1212

13-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13+
2. Redistributions in binary form must reproduce the above copyright notice,
14+
this list of conditions and the following disclaimer in the documentation
15+
and/or other materials provided with the distribution.
1416

15-
See http://www.mathertel.de/License.aspx
17+
3. Neither the name of the copyright holder nor the names of its
18+
contributors may be used to endorse or promote products derived from
19+
this software without specific prior written permission.
20+
21+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
# Arduino Library for LiquidCrystal displays with I2C PCF8574 adapter
22

3+
[![Arduino Library Checks](https://github.com/mathertel/LiquidCrystal_PCF8574/actions/workflows/arduino-checks.yml/badge.svg)](https://github.com/mathertel/LiquidCrystal_PCF8574/actions/workflows/arduino-checks.yml)
4+
5+
[![arduino-library-badge](https://www.ardu-badge.com/badge/LiquidCrystal_PCF8574.svg?)](https://www.ardu-badge.com/LiquidCrystal_PCF8574)
6+
7+
[![GitLicense](https://gitlicense.com/badge/mathertel/LiquidCrystal_PCF8574)](https://gitlicense.com/license/mathertel/LiquidCrystal_PCF8574)
8+
39
A library for driving LiquidCrystal displays (LCD) by using the I2C bus and an PCF8574 I2C adapter.
410

5-
There are modules that can be soldered or stacked to the display that offers a I2C interface for communication instead of the 8+ digital lines that are used to send data to the display.
11+
There are modules that can be soldered or stacked to the display that offers an I2C interface for communication instead of the 8+ digital lines that are used to send data to the display.
612

7-
Most of these modules used the internal wiring that is supported by this library. If you use a module with a different wiring you can adjust this in the code (see comments).
13+
Most of these modules use the wiring that is supported by this library's default configuration.
14+
If you use a module with a different wiring, you can use one of the class constructors which allow you to specify the pin assignments.
815

916
See the web site for more details and pictures: <https://www.mathertel.de/Arduino/LiquidCrystal_PCF8574.aspx>
1017

18+
## Changes Version 2.0.0 (2022-05-26)
19+
20+
* The interface was modified to use 8-bit datatypes as supported by the underling hardware.
21+
* A createChar version with PROGMEM character data for AVR processors was added.
22+
* A constructor with pin assignments was added to allow easy adoption to other wirings than the default.
23+
24+
Thanks to additions from @markisch.

examples/LiquidCrystal_PCF8574_Test/LiquidCrystal_PCF8574_Test.ino

+26-12
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
#include <LiquidCrystal_PCF8574.h>
22
#include <Wire.h>
33

4-
LiquidCrystal_PCF8574 lcd(0x27); // set the LCD address to 0x27 for a 16 chars and 2 line display
4+
LiquidCrystal_PCF8574 lcd(0x27); // set the LCD address to 0x27 for a 16 chars and 2 line display
55

66
int show = -1;
77

8-
void setup()
9-
{
8+
// 2 custom characters
9+
10+
byte dotOff[] = { 0b00000, 0b01110, 0b10001, 0b10001,
11+
0b10001, 0b01110, 0b00000, 0b00000 };
12+
byte dotOn[] = { 0b00000, 0b01110, 0b11111, 0b11111,
13+
0b11111, 0b01110, 0b00000, 0b00000 };
14+
15+
void setup() {
1016
int error;
1117

1218
Serial.begin(115200);
@@ -16,7 +22,7 @@ void setup()
1622
while (!Serial)
1723
;
1824

19-
Serial.println("Dose: check for LCD");
25+
Serial.println("Probing for PCF8574 on address 0x27...");
2026

2127
// See http://playground.arduino.cc/Main/I2cScanner how to test for a I2C device.
2228
Wire.begin();
@@ -28,17 +34,19 @@ void setup()
2834
if (error == 0) {
2935
Serial.println(": LCD found.");
3036
show = 0;
31-
lcd.begin(16, 2); // initialize the lcd
37+
lcd.begin(16, 2); // initialize the lcd
38+
39+
lcd.createChar(1, dotOff);
40+
lcd.createChar(2, dotOn);
3241

3342
} else {
3443
Serial.println(": LCD not found.");
35-
} // if
44+
} // if
3645

37-
} // setup()
46+
} // setup()
3847

3948

40-
void loop()
41-
{
49+
void loop() {
4250
if (show == 0) {
4351
lcd.setBacklight(255);
4452
lcd.home();
@@ -96,10 +104,16 @@ void loop()
96104
lcd.clear();
97105
lcd.print("write-");
98106

99-
} else if (show > 12) {
107+
} else if (show == 13) {
108+
lcd.clear();
109+
lcd.print("custom 1:<\01>");
110+
lcd.setCursor(0, 1);
111+
lcd.print("custom 2:<\02>");
112+
113+
} else {
100114
lcd.print(show - 13);
101-
} // if
115+
} // if
102116

103117
delay(1400);
104118
show = (show + 1) % 16;
105-
} // loop()
119+
} // loop()

keywords.txt

+2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ autoscroll KEYWORD2
2929
noAutoscroll KEYWORD2
3030
setBacklight KEYWORD2
3131
createChar KEYWORD2
32+
createChar_P KEYWORD2
3233
setCursor KEYWORD2
3334
write KEYWORD2
35+
command KEYWORD2
3436

3537
#######################################
3638
# Instances (KEYWORD2)

library.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name=LiquidCrystal_PCF8574
2-
version=1.2.0
2+
version=2.0.0
33
author=Matthias Hertel
44
maintainer=Matthias Hertel <www.mathertel.de>
55
sentence=A library for driving LiquidCrystal displays (LCD) by using the I2C bus and an PCF8574 I2C adapter.
66
paragraph=This library uses the original Wire library for communication.
7-
category=Communication
7+
category=Display
88
url=https://www.mathertel.de/Arduino/LiquidCrystal_PCF8574.aspx
99
architectures=*

0 commit comments

Comments
 (0)