Skip to content

Commit

Permalink
version 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinlyonsrepo committed Apr 30, 2023
1 parent 231533c commit 8f789fe
Show file tree
Hide file tree
Showing 13 changed files with 789 additions and 702 deletions.
42 changes: 25 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/paypalme/whitelight976)
[![Website](https://img.shields.io/badge/Website-Link-blue.svg)](https://gavinlyonsrepo.github.io/) [![Rss](https://img.shields.io/badge/Subscribe-RSS-yellow.svg)](https://gavinlyonsrepo.github.io//feed.xml) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/paypalme/whitelight976)


![ lcd ](https://github.com/gavinlyonsrepo/pic_16F1619_projects/blob/master/images/LCDPCF.jpg)
![ lcd image ](https://github.com/gavinlyonsrepo/pic_16F1619_projects/blob/master/images/LCDPCF.jpg)

# Hd44780_LCD_PCF8574

Table of contents
---------------------------

* [Overview](#overview)
* [Installation](#installation)
* [Software](#software)
* [Output](#output)
* [Tested](#tested)
* [Ports](#ports)
* [Tested on](#tested-on)
* [Notes](#notes)

Overview
--------------------
* Name : HD44780_LCD_PCF8574
Expand All @@ -31,11 +34,16 @@ Overview
Installation
------------------------------

The library is included in the official Arduino library manger and the optimum way to install it is using the library manager which can be opened by the manage libraries option in Arduino IDE.
The library is included in the official Arduino library manger and the optimum way to install it is using the library manager in the Arduino IDE.

Software
--------------------------

See link below for instruction for this and for the other methods too.
**API**

[Installing Additional Arduino Libraries guide](https://www.arduino.cc/en/Guide/Libraries)
The API (application programming interface) html documentation is at link. Hosted on github pages and generated by Doxygen software. Here the user will find lots of information on files, functions & data types.

[Software API Url Link](https://gavinlyonsrepo.github.io/misc/software_docs/HD44780_LCD_PCF8574/index.html)

Output
---------------------
Expand All @@ -48,22 +56,22 @@ Output of custom character test in testrun example file on 16x02 display.

![ pic2 ](https://github.com/gavinlyonsrepo/HD44780_LCD_PCF8574/blob/main/extras/image/2004.jpg)

Tested
Tested on
------------------------

Tested on following MCUs.
The example files are setup for an UNO/NANO for the pin connections used
by for other MCU testing see extras/doc folder GPIO_MCU_used.MD file.
The example files are setup for an UNO/NANO rev 3.0 for the pin connections used
by for other MCU testing see extras/doc folder GPIO_MCU_used.txt file.

1. Arduino UNO & NANO v3
2. ESP8266
3. ESP32
4. STM32 "blue pill", Can support both I2C ports , In example files comment in #define STM32_BLUE_PILL_SETUP
and pick which port you want. Added in Version 1.2.0.
4. STM32 "blue pill", Can support both I2C ports , Use STM32 example file.

Ports
Notes
------------------------

Raspberry Pi C++ : [URL link](https://github.com/gavinlyonsrepo/HD44780_LCD_RPI)

PIC XC32 : [URL link](https://github.com/gavinlyonsrepo/pic_32_projects)
1. "stm32duino" board manager core used in testing STM32 "blue pill"
2. For description of entry modes , cursor types, custom characters etc [See]( http://dinceraydin.com/lcd/commands.htm)
3. 16X04 board not tested but should work.
4. I2C Debugging can be turned on by commenting in a define in header file.
30 changes: 9 additions & 21 deletions examples/HelloWorld/HelloWorld.ino
Original file line number Diff line number Diff line change
@@ -1,38 +1,26 @@
/*
* File: HelloWorld.ino
* Author: Gavin Lyons.
* Description: See URL for full details.
* URL: https://github.com/gavinlyonsrepo/HD44780_LCD_PCF8574
*/
/*!
@file HelloWorld.ino
@author Gavin Lyons
@brief
Hello World for HD44780_LCD_PCF8574 arduino library
*/

// Section: Included library
#include "HD44780_LCD_PCF8574.h"

// Section: Defines
#define DISPLAY_DELAY_INIT 50 // mS
// **** NOTE :: Comment in If using STM32 bluepill ****
//#define STM32_BLUE_PILL_SETUP


// Section: Globals
#ifdef STM32_BLUE_PILL_SETUP // *** STM32 Blue Pill ***
// Set-up Choice I2C interface 1 or 2 :: pick one and one only
TwoWire Wire2(1,I2C_FAST_MODE); // Use STM32 I2C1
//TwoWire Wire2(2,I2C_FAST_MODE); // Use STM32 I2C2
HD44780LCD myLCD(2, 16, 0x27, &Wire2); // LCD object.rows ,cols ,PCF8574 I2C addr, Interface)
#else
// myLCD(rows , cols , PCF8574 I2C address)
HD44780LCD myLCD( 2, 16, 0x27); // instantiate an object
#endif
HD44780LCD myLCD(2, 16, 0x27, &Wire); // instantiate an object

// Section: Setup

void setup() {
delay(DISPLAY_DELAY_INIT);
myLCD.PCF8574_LCDInit(LCDCursorTypeOn);
myLCD.PCF8574_LCDInit(myLCD.LCDCursorTypeOn);
myLCD.PCF8574_LCDClearScreen();
myLCD.PCF8574_LCDBackLightSet(true);
myLCD.PCF8574_LCDGOTO(LCDLineNumberOne, 0);
myLCD.PCF8574_LCDGOTO(myLCD.LCDLineNumberOne, 0);
}

// Section: Main Loop
Expand Down
40 changes: 40 additions & 0 deletions examples/HelloWorldSTM32/HelloWorldSTM32.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*!
@file HelloWorldSTM32.ino
@author Gavin Lyons
@brief
Hello World for HD44780_LCD_PCF8574 arduino library for STM32 "blue pill"
@note Allows testing of both I2C ports 1 and 2 on the STM32 "blue pill" board
*/

// Section: Included library
#include "HD44780_LCD_PCF8574.h"

// Section: Defines
#define DISPLAY_DELAY_INIT 50 // mS
#define STM_I2C1_PORT 1 // STM32 I2C port 1 = I2C1
#define STM_I2C2_PORT 2 // STM32 I2C port 2 = I2C2

// Section: Globals
TwoWire Wire2(STM_I2C1_PORT); // use I2C1 Port 1
HD44780LCD myLCD(2, 16, 0x27, &Wire2);

// Section: Setup

void setup() {
delay(DISPLAY_DELAY_INIT);
myLCD.PCF8574_LCDInit(myLCD.LCDCursorTypeOn);
myLCD.PCF8574_LCDClearScreen();
myLCD.PCF8574_LCDBackLightSet(true);
myLCD.PCF8574_LCDGOTO(myLCD.LCDLineNumberOne, 0);
}

// Section: Main Loop

void loop() {
char testString[] = "Hello World";
myLCD.PCF8574_LCDSendString(testString);
myLCD.PCF8574_LCDSendChar('!'); // Display a single character
while (true) {};
}

// EOF
Loading

0 comments on commit 8f789fe

Please sign in to comment.