Formatting & wording

Michael Ingraham 2019-08-22 11:15:14 -04:00
parent 6e8808d34a
commit d35dc54cb9
1 changed files with 46 additions and 52 deletions

@ -1,23 +1,23 @@
Display support is still in active development.
All display commands:
## Display Commands
|Command | Parameters
|:--- | :---
<a id="Display"> </a> Display | Show current display setting as JSON string
<a id="DisplayAddress"> </a> DisplayAddress | `0..255` = set display module address
<a id="DisplayDimmer"> </a> DisplayDimmer | `0` = switch the display off<BR> `1..100` = switch the display on<BR>`0..100` = set display luminosity *(only on 8x8 Dot-Matrix displays)*
<a id="DisplayMode"> </a> DisplayMode | `0..5` = set to display [predefined content](#displaymode-parameters) according to display type
<a id="DisplayModel"> </a> DisplayModel | Set model of your display:<BR>`1` = [I2C LCD Display](https://learn.adafruit.com/i2c-spi-lcd-backpack) (default addresses `0x27`, `0x3F`)<BR>`2` = [SSD1306](https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples) OLED 128x32/128x64 (default i2c addresses `0x3C`, `0x3D`)<BR>`3` = [HT16K33](https://www.adafruit.com/product/1427) 8x8 Dot-Matrix<BR>`4` = [ILI9341](https://www.adafruit.com/product/1770) TFT LCD<BR>`5` = [2.9 inch E-Paper Display](https://www.waveshare.com/wiki/2.9inch_e-Paper_Module) 296x128 (software 3-wire SPI)<BR>`6` = [4.2 inch E-Paper Display](https://www.waveshare.com/wiki/4.2inch_e-Paper_Module) 400x300 (software 3-wire SPI)<BR>`7` = [SH1106](https://www.ebay.de/itm/1-3-OLED-Display-Weis-SH1106-128x64-I2C-Modul-Arduino-Raspberry-Pi/162572755829?hash=item25da176375:g:hdgAAOSwQKZdQZ10) OLED 128x64 (default i2c address `0x3c`)<BR>`8` = [ILI9488](https://www.buydisplay.com/default/lcd-3-5-inch-320x480-tft-display-module-optl-touch-screen-w-breakout-board) TFT 480x320 (capacitive touch, hardware 3-wire SPI)<BR>`9` = [SSD1351](https://www.ebay.de/itm/1-5-128x128-OLED-Display-Modul-RGB-SPI-Interface-Arduino-Raspberry-Pi/123256209315?hash=item1cb2a47fa3:g:WtsAAOSwZb5bTfjF) color OLED 128x128 (hardware 3-wire SPI)<BR>`10` = [RA8867](https://www.buydisplay.com/default/spi-7-inch-tft-lcd-dislay-module-1024x600-ra8876-optl-touch-screen-panel) TFT LCD 1024x600 (capacitive touch, hardware 4-wire SPI)
<a id="DisplayRefresh"> </a> DisplayRefresh | `1..7` = set time in seconds to update predefined content when using `DisplayMode` &ne; `0`
<a id="DisplaySize"> </a> DisplaySize | `1..4` = set display scale-up size (only for `DisplayModel 2` (SSD1306 OLED) and `DisplayModel 4` (ILI9341 TFT LCD))
<a id="Display"> </a> Display | Show current display setting as a JSON payload
<a id="DisplayAddress"> </a> DisplayAddress | `0..255` Set display module address
<a id="DisplayDimmer"> </a> DisplayDimmer | `0` Turn the display off<BR> `1..100` Turn the display on<BR>`0..100` Set display luminosity *(only on 8x8 Dot-Matrix displays)*
<a id="DisplayMode"> </a> DisplayMode | `0..5` Set to display [predefined content](#displaymode-parameters) according to display type
<a id="DisplayModel"> </a> DisplayModel | Set display model:<BR>`1` = [I<sup>2</sup>C LCD Display](https://learn.adafruit.com/i2c-spi-lcd-backpack) (default addresses `0x27`, `0x3F`)<BR>`2` = [SSD1306](https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples) OLED 128x32/128x64 (default I<sup>2</sup>C addresses `0x3C`, `0x3D`)<BR>`3` = [HT16K33](https://www.adafruit.com/product/1427) 8x8 Dot-Matrix<BR>`4` = [ILI9341](https://www.adafruit.com/product/1770) TFT LCD<BR>`5` = [2.9 inch E-Paper Display](https://www.waveshare.com/wiki/2.9inch_e-Paper_Module) 296x128 (software 3-wire SPI)<BR>`6` = [4.2 inch E-Paper Display](https://www.waveshare.com/wiki/4.2inch_e-Paper_Module) 400x300 (software 3-wire SPI)<BR>`7` = [SH1106](https://www.ebay.de/itm/1-3-OLED-Display-Weis-SH1106-128x64-I2C-Modul-Arduino-Raspberry-Pi/162572755829?hash=item25da176375:g:hdgAAOSwQKZdQZ10) OLED 128x64 (default I<sup>2</sup>C address `0x3c`)<BR>`8` = [ILI9488](https://www.buydisplay.com/default/lcd-3-5-inch-320x480-tft-display-module-optl-touch-screen-w-breakout-board) TFT 480x320 (capacitive touch, hardware 3-wire SPI)<BR>`9` = [SSD1351](https://www.ebay.de/itm/1-5-128x128-OLED-Display-Modul-RGB-SPI-Interface-Arduino-Raspberry-Pi/123256209315?hash=item1cb2a47fa3:g:WtsAAOSwZb5bTfjF) color OLED 128x128 (hardware 3-wire SPI)<BR>`10` = [RA8867](https://www.buydisplay.com/default/spi-7-inch-tft-lcd-dislay-module-1024x600-ra8876-optl-touch-screen-panel) TFT LCD 1024x600 (capacitive touch, hardware 4-wire SPI)
<a id="DisplayRefresh"> </a> DisplayRefresh | `1..7` Set time in seconds to update predefined content when using `DisplayMode` &ne; `0`
<a id="DisplaySize"> </a> DisplaySize | `1..4` Set display scale-up size *(SSD1306 and ILI9341 only)*
<a id="DisplayRotate"> </a> DisplayRotate | Set rotation angle<BR> `0` = 0°<BR> `1` = 90°<BR> `2` = 180°<BR> `3` = 270°
<a id="DisplayText"> </a> DisplayText | `<value>` = for a full guide see [DisplayText use](displays#displaytext-use)
<a id="DisplayCols"> </a> DisplayCols | `1..44` = set number of display columns (for display modes>0)
<a id="DisplayRows"> </a> DisplayRows | `1..32` = set number of display rows (for display modes>0)
<a id="DisplayFont"> </a> DisplayFont | specifies the current font ((1=12, 2=24,(opt 3=8)) if font==0 the classic GFX font is used if font==7 the RA8876 internal font is used
<a id="DisplayWidth"> </a> DisplayWidth | specifies the display width in pixels (settable only on ssd1306)
<a id="DisplayHeight"> </a> DisplayHeight | specifies the display height in pixels (settable only on ssd1306)
<a id="DisplayText"> </a> DisplayText | `<value>` - See [DisplayText use](displays#displaytext-use)
<a id="DisplayCols"> </a> DisplayCols | `1..44` Set number of display columns *(for display modes>0)*
<a id="DisplayRows"> </a> DisplayRows | `1..32` Set number of display rows *(for display modes>0)*
<a id="DisplayFont"> </a> DisplayFont | Specify the current font<BR>`0` use classic GFX font<BR>`1` = 12<BR>`2` = 24<BR>`3` = 8 (opt)<BR>`7` use RA8876 internal font
<a id="DisplayWidth"> </a> DisplayWidth | Specify the display width in pixels *(SSD1306 only)*
<a id="DisplayHeight"> </a> DisplayHeight | Specify the display height in pixels *(SSD1306 only)*
## DisplayMode Parameters
@ -33,32 +33,30 @@ Parameter | LCD Display | OLED Display | TFT Display
4 | Local sensors | MQTT and local sensors | MQTT and local sensors
5 | MQTT and Time/Date | MQTT, local sensors and Time/Date | MQTT, local sensors and Time/Date
## Compilation \#define directives used
## Compilation \#define Directives Used
Feature | Description
| -- | -- |
USE_DISPLAY | enables display support in general + at least one of the following display defines
USE_DISPLAY_LCD | enables LCD display need also USE_I2C
USE_DISPLAY_SSD1306 | enables OLED SSD106 display need also USE_I2C
USE_DISPLAY_MATRIX | enables MATRIX display
USE_DISPLAY_ILI9341 | enables TFT display need also USE_SPI
USE_DISPLAY_EPAPER_29 | enables EPAPER display need also USE_SPI
USE_DISPLAY_EPAPER_42 | enables EPAPER display need also USE_SPI
USE_DISPLAY_SH1106 | enables OLED SH1106 display need also USE_I2C
USE_DISPLAY_ILI9488 | enables TFT ILI9488 display need also USE_SPI
USE_DISPLAY_SSD1351 | enables OLED SSD1351 display need also USE_SPI
USE_DISPLAY_RA8876 | enables TFT RA8876 display need also USE_SPI
USE_TOUCH_BUTTONS | enable virtual touch button support with touch displays
SHOW_SPLASH | enable init message on display
USE_AWATCH | enables support analog watch
USE_GRAPH | enable line charts also define, e.g., `#define NUM_GRAPHS 4`
USE_DISPLAY | Enable display support. Also requires at least one of the following compilation directives
USE_DISPLAY_LCD | Enable LCD display. Also requires `USE_I2C`
USE_DISPLAY_SSD1306 | Enable OLED SSD106 display. Also requires `USE_I2C`
USE_DISPLAY_MATRIX | Enable MATRIX display
USE_DISPLAY_ILI9341 | Enable TFT display. Also requires `USE_SPI`
USE_DISPLAY_EPAPER_29 | Enable EPAPER_29 display. Also requires `USE_SPI`
USE_DISPLAY_EPAPER_42 | Enable EPAPER_42 display. Also requires `USE_SPI`
USE_DISPLAY_SH1106 | Enable OLED SH1106 display. Also requires `USE_I2C`
USE_DISPLAY_ILI9488 | Enable TFT ILI9488 display. Also requires `USE_SPI`
USE_DISPLAY_SSD1351 | Enable OLED SSD1351 display. Also requires `USE_SPI`
USE_DISPLAY_RA8876 | Enable TFT RA8876 display. Also requires `USE_SPI`
USE_TOUCH_BUTTONS | Enable virtual touch button support with touch displays
SHOW_SPLASH | Enable initialization splash message on the display
USE_AWATCH | Enables analog watch support
USE_GRAPH | Enable line charts. Also requires `NUM_GRAPHS`
# DisplayText Use
The `DisplayText` command is used to display text as well as graphics and graphs on LCD, OLED and e-Paper
displays. The command argument is a string that is printed on the display at the current position.
displays (EPD). The command argument is a string that is printed on the display at the current position.
The string can be prefixed by embedded control commands enclosed in brackets `[]`.
In order to use the `DisplayText` command the `DisplayMode` must be set to `0` (or optional `1` on LCD displays) or other modes must be disabled before compilation with `#undef USE_DISPLAY_MODES1TO5`.
@ -104,7 +102,7 @@ and either x or x for the horizontal position. Neither x nor y are advanced/upda
`t` = display Tasmota time in HH:MM
`tS` = display Tasmota time in HH:MM:SS
`T` = display Tasmota date in DD.MM.YY
`pp` = pad text with spaces, positiv values align left, negativ values
`pp` = pad text with spaces, positive values align left, negative values
align right
`sp` = set text scaling for classic GFX font (scaling factor 1...N)
`fp` = set font (1=12, 2=24,(opt 3=8)) if font==0 the classic GFX font is used, if font==7 RA8876 internal font is used
@ -113,7 +111,7 @@ align right
`Cip` = set foreground index color (0..18) for color displays (see index color table below)
`Bip` = set background index color (0..18) for color displays (see index color table below)
`wp` = draws an analog watch with radius p (#define USE_AWATCH)
`Pfilename:` = display an rgb 16bit color image when sdcard file system is present
`Pfilename:` = display an rgb 16-bit color image when SD card file system is present
### Touch Buttons
(`#define USE_TOUCH_BUTTONS`)
@ -181,29 +179,25 @@ Selected with `Ci` and `Bi` in the ILI9488, SSD1351, and RA8876 color panels
## Notes about e-Paper displays
E-Paper displays have 2 operating modes: full update and partial update.
While full update delivers a clean and sharp picture it has the disadvantage of taking several seconds for the screen update and shows severe flickering during update.
Partial update is quite fast (300 ms) with no flickering but there is the possibility that erased content is still slightly visible.
To refresh the display it is therefore useful to perform a full update in regular intervals (e.g each hour).
E-Paper displays have 2 operating modes: full update and partial update. While full update delivers a clean and sharp picture, it has the disadvantage of taking several seconds for the screen update and shows severe flickering during update. Partial update is quite fast (300 ms) with no flickering but there is the possibility that erased content is still slightly visible. It is therefore useful to perform a full update in regular intervals (e.g., each hour) to fully refresh the display.
Compilation directives: `#define USE_SPI`, `#define USE_DISPLAY`, `#define USE_DISPLAY_EPAPER29`, or `#define USE_DISPLAY_EPAPER42`
Remark: the 4.2 epaper requires about 15k of RAM. Therefore it only works with Core 2.42 and above
**Remark**: the 4.2 e-Paper display requires about 15k of RAM. Therefore it only works with Core 2.42 and above.
## OLED Lifetime
The lifetime of an OLED when permanently on ist specified at about 10000 hours (416 days) (dimming to 50% expands the lifetime to about 25000 hours)
The typical specifications for the lifetime of an OLED when permanently on is about 10000 hours (416 days). Dimming to 50% expands the lifetime to about 25000 hours.
## Burn-in
The data sheets of the TFT and OLED displays mention burn in effects when a static display is shown for extended periods of time. You may consider switching the display on on demand only.
The data sheets of the TFT and OLED displays mention burn-in effects when a static display is shown for extended periods of time. You may want to consider turning on the display on demand only.
## Fonts
The EPD fonts contains 95 characters starting from code 32 while the classic GFX font contains 256 characters ranging from 0 to 255. To display characters above code 127 you must specify an escape sequence (standard octal escapes don't work). The `~`character followed by a hex byte can define any character code. So custom characters above 127 can be displayed
The EPD font contains 95 characters starting from code 32, while the classic GFX font contains 256 characters ranging from 0 to 255. Custom characters above 127 can be displayed. To display these characters, you must specify an escape sequence (standard octal escapes do not work). The `~`character followed by a hex byte can define any character code.
GFXFont:
![GFXFont](https://user-images.githubusercontent.com/11647075/63440218-bb83e100-c42f-11e9-810c-74099f851902.jpg)
EPDFont:
EPDFont:
![EPDFont](https://user-images.githubusercontent.com/11647075/63440222-be7ed180-c42f-11e9-9be3-2f446fc28037.jpg)
## Hardware Connections
@ -211,7 +205,7 @@ I<sup>2</sup>C displays are connected in the usual manner and defined via the GP
The I<sup>2</sup>C address must be specified using `DisplayAddress XX`, e.g., `60`. The model must be spedified with `DisplayModel`, e.g., `2` for SSD1306. To permanently turn the display on set `DisplayDimmer 100`. Display rotation can be permanently set using `DisplayRotate X` (x = `0..3`).
E-Paper displays are connected via software 3-wire SPI `(CS, SCLK, MOSI)` the other three interface lines of the display
E-Paper displays are connected via software 3-wire SPI `(CS, SCLK, MOSI)`. The other three interface lines of the display
(DC, Reset, busy) may be left unconnected. The jumper on the circuit board of the display must be set to 3-wire SPI.
The ILI9488 and SSD1351 are connected via hardware 3-wire SPI `(MOSI=GPIO13, SCLK=GPIO14,CS=GPIO15)`. The ILI9488 must also be connected to the backlight pin (dimmer supported on SSD1351)
@ -264,19 +258,19 @@ rule1 on tele-BME280#Temperature do DisplayText [s1p21x0y0]Temp: %value% C endon
Waveshare has two kinds of display controllers: with partial update and without partial update. The 2.9 inch driver is for partial update and should also support other Waveshare partial update models with modified WIDTH and HEIGHT parameters. The 4.2 inch driver is a hack which makes the full update display behave like a partial update and should probably work with other full update displays.
The drivers are sub classes of the Adafruit GFX library. The class hierarchy is `LOWLEVEL :: Paint :: Renderer :: GFX`, where:
The drivers are subclasses of the Adafruit GFX library. The class hierarchy is `LOWLEVEL :: Paint :: Renderer :: GFX`, where:
`GFX`: unmodified Adafruit library
`Renderer`: the interface for Tasmota
`Paint`: the modified pixel driver for e-paper
- there are several virtual functions that can be subclassed down to `LOWLEVEL`.
The display dispatcher only does the class init call. All other calls go to the `Renderer` class.
The display dispatcher only does the class initialization call. All other calls go to the `Renderer` class.
In black and white displays a local RAM buffer must be allocated before calling the driver. This must be set to zero on character or TFT color displays.
In black and white displays, a local RAM buffer must be allocated before calling the driver. This must be set to zero on character or TFT color displays.
To use the 400x300 e-Paper display the Arduino library 2.4 or later must be used because it leaves much more RAM available than prior versions. This display requires 15k of RAM!
**Remark**: To use the 400x300 e-Paper display, the Arduino library 2.4 or later must be used because it leaves much more RAM available than prior versions. This display requires 15k of RAM!
The epd fonts use about 9k space, which can be selected at compile time using \#ifdef directives.
The EPD fonts use about 9k space, which can be selected at compile time using \#ifdef directives.
- SSD1306 - 1.15k
- EPD42 - 2.57k