User Tools

Site Tools


users:dagnall53:rocdisplaytop

Index

Roc Display Compatible Hardware

From WiRocs Version 12, a simplified version of Roc-Display compatible text parsing is included in WiRocS.

To use two I2C OLED displays with Identical I2C addresses, the code has two software controlled I2C buses.
In "Normal" Operations, you can have two addressable (61 and 60) OLEDS on the main I2C bus. And Two more on the Secondary Bus.
By using the RocDisplay Format Commands {S6} ,{S3} and {SE} to control a "_32" mode. This select the set up the two '60 address OEDS to be either *64 high or *32 high.
All {S x} Settings are saved non volatile, (when the {SE}command is sent), so this only needs to be done once.


RocDisplay Fonts, BitMaps and Compatibility

My interpretation of the RocDisplay includes four fonts of various sizes to allow a number of display effects. img_2738.jpg
The fonts I have used are all copies of Walter Sax's original RocDisplay fonts and bitmaps.
The fonts were edited with GlyphEditor2 . The font files are here

See this for detailed RocDisplay compatibility information:


Sending Messages to the Display

Rocdisplay sends messages as text to a text object with an interface defined with "Bus, Address and Display" parameters. 'Bus' will be the WiRocS Rocnet node. Address(I2C) is the I2C address of the OLED (60 or 61). The 'Display/Weergrave' setting is 1-8. In my adaptation, each of my OLEDS can show text from 2 or more "text objects".

For more details see: 'How send Messages to WiRocS OLEDS'

 The 64 high displays can show four RocDisplay messages each.   
   * OLED1 ('60 address on Primary I2C bus) shows messages for "text objects" (50,60,1-4)
   * OLED2 ('61 address on Primary I2C bus )shows messages for "text objects" (50,61,5-8)
   * OLED3 ('60 address on Secondary I2C bus )shows messages for "text objects" (50,60,1-4) (Secondary I2C bus).
   * OLED4 ('61 address on Secondary I2C bus )shows messages for "text objects" (50,61,5-8) (Secondary I2C bus)

If switched to '32 high displays' the internal references of the OLEDS change.
and they will show Two RocDisplay messages each.

   
   * OLED5 ('60 address on Primary I2C bus) shows messages for "text objects" (50,60,1-2)
   * OLED6 ('60 address on Secondary I2C bus) shows messages for "text objects" (50,60,3-4)

ESP8266 Use with NodeMCU Motor Shield

On the ESP8266 version, the I2C bus uses uses pin D3 and pin D4, which (when the board is on the Motor shield) are the 'Motor direction' pins.

Pins D1 and D2 remain connected to the 'Motor PWM' pins.

This means that the Motor Shield outputs can still be used as dimmable filament light drives (because the "direction" (being changed all the time as these pins are the OLED data) does not matter to a filament light!).

Some small modifications are needed to the Motor Shield to change the middle row of pins from 3V3 to 5V. These are described in detail here


Example of 128*32 in default display mode

If no "RocDisplay" formatted messages have been sent to the display, it will default to showing a Synchronized clock showing RocRail time, a WiFi Signal strength indicator and a RocRail power on/off indicator. The clock does not need any extra code in Rocrail, and uses the Time Synchronization messages that the RocNet protocol sends out (usually every minute)


Some "RocDisplay" Message Examples

If RocRail sends any "RocDisplay" formatted messages to the text objects, the WiRocS parser will try and decode them. See here for more information: A RocDisplay message includes formatting codes within '{ }' brackets. This example shows how two messages, each with two lines of text, are displayed on a single 128*32 display ('OLED4' - which displays messages sent to 'text object' eg (50,60,1) and 'text object 2' (eg (50,60,2)).

The code to give this display is:

   {F0}9{F2}3/4{F0T0}Hogwarts {F2L1T0}Express Non Stop{F1T1L0}10:13{P}, sent to text object with interface Bus 50, Address 60, Display 1
   {F0}2 {T0} Basingstoke{L1T0F2}Via wimbledon{F1L0T1}10:05 {P} sent to text object with interface Bus 50, Address 60, Display 2''

The Clock on the left is updated every second by an internal clock in each Node, and Synchronized to RocRail by the standard Rocnet protocol synchronization that is automatically sent out , normally every minute.

An example using a slightly modified version of Peters "RocDisplay" example workspace is shown here on a 128*64 display (OLED1) (Note there are only 3 text objects messages in this example) Here I selected Right Clock in some earlier code (The clock Left/Right On/Off is saved in EEprom so only needs to be sent once) The code here was

   {EB7} 235 {F1}{T0L1F0} Krems {T1L0B10L1T1F2} 8:24 {P}           (to text object 1)
   {EB0W110} 1 {F1}{T0L1F0} Wr. Neustadt {T1L0B10L1T1F2} 8:17 {P}  (to text object 2)
   {EB0} 80 {F1}{T0L1F0} Hirschstetten {T1L0B10L1T1F2} 8:15 {P}    (to text object 3)

Note that line 2 (sent to "text object 2 ") includes a "Width" =110(pixels). This moves Tab one (used for the time) to 110 from the default 102.(It automatically has the clock Diameter subtracted if the clock is on). Note also the sequencing of the L and T parameters in the last set of formatting for each message. Because of the way the message is sent to the screen, WiRocS needs to know which line is being sent BEFORE the T1 command is accepted. BUT I have some extra code so that providing the 'Lx' IMMEDIATELY follows the 'T', the code can now also accept this.


users/dagnall53/rocdisplaytop.txt · Last modified: 2019/03/22 23:00 by dagnall53