Skip to content

Commit

Permalink
Dev (#5)
Browse files Browse the repository at this point in the history
* Fixed Readme format
  • Loading branch information
phoeluga committed Mar 5, 2021
1 parent 5574486 commit 7f2f714
Showing 1 changed file with 0 additions and 70 deletions.
70 changes: 0 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,26 +77,16 @@ The postfix allows you to put a constant text like "*°C "* - for temperature -
(This field is optional and need not be used if it is not needed)

## Usage
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> main
1. Install the required libraries from Software Prerequisites.
2. Download this repository and extract it.
3. Copy the module `HD44780.py` to your project
4. Import the module:
```python
from HD44780 import HD44780
```
<<<<<<< HEAD
5. Instantiate the class:
```python
lcd = HD44780(config.lcdI2cExpanderType, config.lcdI2cAddress, config.lcdColumnCount, config.lcdRowCount)
=======
5. Instantiate the class (Sample with a HD44780 2004 LCD - 20 columns / 4 rows):
```python
lcd = HD44780("PCF8574", 0x27, 20, 4)
>>>>>>> main
```
6. Create a frame:
```python
Expand All @@ -113,46 +103,6 @@ The postfix allows you to put a constant text like "*°C "* - for temperature -
```

## Sample
<<<<<<< HEAD

Find a detailed sample script in the folder `sample` of this repository.
You should be able to run it from scratch with just adapting the LCD I2C settings in the `config.py` file.

## API Reference

### Classes

* <u>`HD44780(CharLCD)`</u>
This is the main class that inherits `RPLCD.i2c CharLCD` from [RPLCD](https://github.com/dbrgn/RPLCD)

#### Public functions:
* <u>`__init__(i2c_expander, address, cols, rows, dotsize=8, expander_params=None, port=1, charmap='A00', linebreaks=True, backlight=True)`</u>
The constructor of this module passes the provided parameters to the parent class `RPLCD.i2c CharLCD` from the [RPLCD](https://github.com/dbrgn/RPLCD) library. The parameters of the I2C expander (`i2c_expander`), the I2C address of the expander (`address`) and the number of columns (`cols`) and rows (`rows`) of the physical display must be provided. All other parameters are optional and have the default value of the parent `RPLCD.i2c CharLCD` class.
* <u>`writeFrame(framebuffer, pageNumber=1, scrollingFrame=False)`</u>
Shows the specified frame as `framebuffer` on the display. If the number of frame rows is larger than the number of rows the display can show, pages are automatically created in the background. The page to be displayed can be specified by the parameter `pageNumber`.
The parameter `scrollingFrame` is only needed in the combination by the call through the function `scrollFrame`. Otherwise it must always be False for a correct output.
This function only displays the content of a frame and does not include a scrolling feature. For this, the function `scrollFrame` must be called.
* <u>`scrollFrame(framebuffer, scrollIn=False, scrollToBlank=False, scrollIfFit=False, delay=0.5, showFirstFrameAfterScroll=True)`</u>
This is the main function that should be used to display the frame content provided in the frame as `framebuffer` on the LCD.
The remaining parameters provide the following functionality:
* <u>`scrollIn`</u>
If `True`, the text is scrolled in from the right side of the LCD. Otherwise, the beginning of the text is displayed before scrolling starts.
* <u>`scrollToBlank`</u>
If `True`, the text is scrolled out to the left until it is no longer visible. Otherwise, the scrolling stops as soon as the text is completely displayed.
* <u>`scrollIfFit`</u>
Specifies whether the text should be scrolled by the parameters `scrollIn` and `scrollToBlank` if the text can also be displayed completely in the LCD row without scrolling.
* <u>`delay`</u>
Specifies the time in seconds to wait between scrolling and before displaying the inserted characters. Defines the scrolling speed.
* <u>`showFirstFrameAfterScroll`</u>
Specifies whether the display should be reset to the output - before/at the start of scrolling - when the function is ended.

* <u>`Frame()`</u>
Instantiate this class for getting a object that represents a frame that holds the frame rows.

#### Classes
* <u>`FrameRow`</u>
=======
Find a detailed sample script in the folder `sample` of this repository.
You should be able to run it from scratch with just adapting the LCD I2C settings in the `config.py` file.

Expand Down Expand Up @@ -207,27 +157,13 @@ The interfaces for integration in your own code are described below.

#### Classes
* `FrameRow`
>>>>>>> main
This is a structure that that have the following attributes as String:
* `id`
* `text`
* `prefix`
* `postfix`

#### Public functions:
<<<<<<< HEAD
* <u>`add(id, text="", prefix="", postfix="")`</u>
Adds a frame row with a specific `id` to the parent frame. All other fields are optional to allow you to provide a blank frame row.
* <u>`addWithGuid(text, prefix="", postfix="")`</u>
Adds a frame row to the parent frame without the need to specific `id`. In case a frame row does not need to be addressed by an ID, then this function can be used, which uses a generated GUID as a reference in the background.
* <u>`getFrame(id, createEmptyRowIfIdNotExist=True)`</u>
Returns a frame row requested by the `id` parameter. If the requested `id` is not found in the parent frame, it can be created if the `createEmptyRowIfIdNotExist` parameter is specified as `True`.
* <u>`removeByIndex(id)`</u>
This function
* <u>`clear()`</u>
This function clears all attributes to an empty string except the `id`
* <u>`updateFrameRow(frameRow)`</u>
=======
* `add(id, text="", prefix="", postfix="")`

Adds a frame row with a specific `id` to the parent frame. All other fields are optional to allow you to provide a blank frame row.
Expand All @@ -250,22 +186,16 @@ The interfaces for integration in your own code are described below.

* `updateFrameRow(frameRow)`

>>>>>>> main
This function will update the provided frame row in the parent frame.


## Changelog

<<<<<<< HEAD
**1.0.2103.0401**
Fixed scrolling issue related to the introduction of the `postfix`
=======
**1.0.2103.0601**
Fixed an issue where the maximum iterations were wrong when the test is scrolled in and scrolled to blank.

**1.0.2103.0401**
Fixed scrolling issue related to the introduction of the `postfix`.
>>>>>>> main

**1.0.2102.1401**
Initial release

0 comments on commit 7f2f714

Please sign in to comment.