Difference between revisions of "Component: GLCD (SH1106) SPI (Graphical Monochrome)"
From Flowcode Help
Jump to navigationJump to search| Line 5: | Line 5: | ||
| |- | |- | ||
| | width="20%" style="color:gray;" | Version | | width="20%" style="color:gray;" | Version | ||
| − | |  | + | | 13.0 | 
| |- | |- | ||
| | width="20%" style="color:gray;" | Category | | width="20%" style="color:gray;" | Category | ||
| Line 19: | Line 19: | ||
|   Library Version, Component Version, Date, Author, Info |   Library Version, Component Version, Date, Author, Info | ||
|   11, 1.0, 22-07-24, BR, Added DrawArc and DrawRoundedRectangle functions |   11, 1.0, 22-07-24, BR, Added DrawArc and DrawRoundedRectangle functions | ||
| + |  13, 1.0, 18-06-25, MW, Updated fonts to new type and added SetContrast function | ||
| ==Detailed description== | ==Detailed description== | ||
| Line 549: | Line 550: | ||
| |- | |- | ||
| | colspan="2" | 0=White, 1=Black  | | colspan="2" | 0=White, 1=Black  | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | ===SetContrast=== | ||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetContrast''' | ||
| + | |- | ||
| + | | colspan="2" | Set the contrast level from 0 to 255  | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | ContrastLevel | ||
| + | |- | ||
| + | | colspan="2" |   | ||
| |- | |- | ||
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| Line 628: | Line 648: | ||
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| | width="90%" | Command | | width="90%" | Command | ||
| + | |- | ||
| + | | colspan="2" |   | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | ===Write_Data=== | ||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Write_Data''' | ||
| + | |- | ||
| + | | colspan="2" |   | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | data | ||
| |- | |- | ||
| | colspan="2" |   | | colspan="2" |   | ||
| Line 670: | Line 709: | ||
| | width="90%" | Foreground Color | | width="90%" | Foreground Color | ||
| |- | |- | ||
| − | | colspan="2" | Specifies the initial foreground color.  | + | | colspan="2" | Specifies the initial foreground color. R,G,and B must be the same value or will default to white  | 
| |- | |- | ||
| | width="10%" align="center" | [[File:Fc9-type-1-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-1-icon.png]] | ||
| Line 772: | Line 811: | ||
| |- | |- | ||
| | colspan="2" | Sets the number of blank pixels between each character when printing text.  | | colspan="2" | Sets the number of blank pixels between each character when printing text.  | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| |- | |- | ||
| | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
Latest revision as of 14:13, 22 October 2025
| Author | Matrix Ltd | 
| Version | 13.0 | 
| Category | Graphical Monochrome | 
Contents
- 1 GLCD (SH1106) SPI component
- 2 Version information
- 3 Detailed description
- 4 Examples
- 5 Macro reference
- 5.1 BPlot
- 5.2 ClearDisplay
- 5.3 DrawArc
- 5.4 DrawCircle
- 5.5 DrawEllipse
- 5.6 DrawLine
- 5.7 DrawRectangle
- 5.8 DrawRoundedRectangle
- 5.9 Initialise
- 5.10 Plot
- 5.11 Print
- 5.12 PrintNumber
- 5.13 ReadFontStat
- 5.14 ReadFontWidth
- 5.15 SetBackgroundColour
- 5.16 SetContrast
- 5.17 SetDisplayOrientation
- 5.18 SetFontScaler
- 5.19 SetForegroundColour
- 5.20 Write_Command
- 5.21 Write_Data
 
- 6 Property reference
- 7 Component Source Code
GLCD (SH1106) SPI component
Graphical display component designed to work with the SH1106 type monochrome displays. Transfers data using a 4-wire SPI interface.
Version information
Library Version, Component Version, Date, Author, Info 11, 1.0, 22-07-24, BR, Added DrawArc and DrawRoundedRectangle functions 13, 1.0, 18-06-25, MW, Updated fonts to new type and added SetContrast function
Detailed description
Click here for an in depth guide to graphical LCDs using Flowcode.
Information on the Fonts available for this component are available here. GLCD Font Subcomponent
Examples
No additional examples
Macro reference
BPlot
|   | BPlot | 
| Sets a pixel with the current background colour at pixel location X, Y. | |
|  - UINT | X1 | 
|  - UINT | Y1 | 
|  - VOID | Return | 
ClearDisplay
|   | ClearDisplay | 
| This macro clears the display of any previous output by overwriting the entire display with the background colour. | |
|  - VOID | Return | 
DrawArc
DrawCircle
DrawEllipse
DrawLine
|   | DrawLine | 
| Draws a line with the current foreground colour from pixel location X1, Y1 to pixel location X2, Y2. | |
|  - UINT | X1 | 
|  - UINT | Y1 | 
|  - UINT | X2 | 
|  - UINT | Y2 | 
|  - VOID | Return | 
DrawRectangle
DrawRoundedRectangle
Initialise
|   | Initialise | 
| The Init macro must be called once to initialise the Graphical LCD display before any other Graphical LCD component macros are called. | |
|  - VOID | Return | 
Plot
|   | Plot | 
| Sets a pixel with the current foreground colour at pixel location X, Y. | |
|  - UINT | X1 | 
|  - UINT | Y1 | 
|  - VOID | Return | 
PrintNumber
ReadFontStat
|   | ReadFontStat | 
| Gets a stat from the selected embedded ASCII font data. | |
|  - BYTE | Font | 
| Font selection range: 0 to (NumFonts - 1) | |
|  - BYTE | Index | 
| 0=SpaceWidth, 1=PixelHeight | |
|  - BYTE | Return | 
ReadFontWidth
SetBackgroundColour
|   | SetBackgroundColour | 
| Specifies the colour of the foreground | |
|  - BYTE | PixelColour | 
| 0=White, 1=Black | |
|  - VOID | Return | 
SetContrast
|   | SetContrast | 
| Set the contrast level from 0 to 255 | |
|  - BYTE | ContrastLevel | 
|  - VOID | Return | 
SetDisplayOrientation
SetFontScaler
SetForegroundColour
|   | SetForegroundColour | 
| Specifies the colour of the foreground. | |
|  - BYTE | PixelColour | 
| 0=White, 1=Black | |
|  - VOID | Return | 
Write_Command
|   | Write_Command | 
|  - BYTE | Command | 
|  - VOID | Return | 
Write_Data
|   | Write_Data | 
|  - BYTE | data | 
|  - VOID | Return | 
Property reference
Component Source Code
Please click here to download the component source project: FC_Comp_Source_GLCD_SH1106_SPI.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_GLCD_SH1106_SPI.fcfx












