Difference between revisions of "Component: Nextion Display (Graphical Color)"
From Flowcode Help
Jump to navigationJump to search(13 intermediate revisions by the same user not shown) | |||
Line 14: | Line 14: | ||
==Nextion Display component== | ==Nextion Display component== | ||
A simple libray to interface a Nextion display. The elements on the nextion display are built using the Nextion Editor software and uploaded to the display. The component can then interact with the display elements. | A simple libray to interface a Nextion display. The elements on the nextion display are built using the Nextion Editor software and uploaded to the display. The component can then interact with the display elements. | ||
+ | |||
+ | ==Component Source Code== | ||
+ | |||
+ | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_API_Display_Nextion.fcfx FC_Comp_Source_API_Display_Nextion.fcfx] | ||
+ | |||
+ | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_API_Display_Nextion.fcfx FC_Comp_Source_API_Display_Nextion.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 24: | Line 50: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 37: | Line 83: | ||
{{Fcfile|NextionTouchDemo.fcfx|Nextion Touch Demo}} | {{Fcfile|NextionTouchDemo.fcfx|Nextion Touch Demo}} | ||
− | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==Macro reference== | ||
+ | |||
+ | ===GetText=== | ||
+ | {| 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;" | '''GetText''' | ||
+ | |- | ||
+ | | colspan="2" | Gets the text of a specific item | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
+ | | width="90%" | Name | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===GetTouchEvent=== | ||
+ | {| 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;" | '''GetTouchEvent''' | ||
+ | |- | ||
+ | | colspan="2" | Collects the next touch event in the queue. Returns 0 for no touch event detected, 1= touch press, 2 = touch release | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===GetTouchID=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 52: | Line 142: | ||
+ | ===GetValue=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 70: | Line 161: | ||
+ | ===Initialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' |
|- | |- | ||
− | | colspan="2" | Sets the | + | | colspan="2" | Sets up the UART connection to the Nextion display |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| 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 93: | Line 175: | ||
+ | ===SetBackgroundColour=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetBackgroundColour''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Sets the background colour of a specific item |
|- | |- | ||
|- | |- | ||
Line 106: | Line 189: | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG |
+ | | width="90%" | Colour | ||
+ | |- | ||
+ | | 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'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===SetFontColour=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 134: | Line 223: | ||
+ | ===SetPage=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 152: | Line 242: | ||
+ | ===SetText=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetText''' |
|- | |- | ||
− | | colspan="2" | Sets the | + | | colspan="2" | Sets the text of a specific item |
|- | |- | ||
|- | |- | ||
Line 165: | Line 256: | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING |
− | | width="90%" | | + | | width="90%" | Text |
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
Line 175: | Line 266: | ||
+ | ===SetValue=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetValue''' |
|- | |- | ||
− | + | | colspan="2" | Sets the numeric value of a specific item | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | colspan="2" | Sets the | ||
|- | |- | ||
|- | |- | ||
Line 202: | Line 281: | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG | | width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG | ||
− | | width="90%" | | + | | width="90%" | Number |
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
Line 209: | Line 288: | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Line 232: | Line 296: | ||
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Communications | ||
|- | |- | ||
|- | |- | ||
Line 274: | Line 342: | ||
| colspan="2" | Time in milliseconds to wait for a reply to a command. | | colspan="2" | Time in milliseconds to wait for a reply to a command. | ||
|- | |- | ||
− | | width="10%" align="center" style="background-color:# | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] |
− | | width="90%" style="background-color:# | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation |
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
|- | |- |
Latest revision as of 13:08, 7 February 2023
Author | Matrix TSL |
Version | 1.0 |
Category | Graphical Color |
Contents
Nextion Display component
A simple libray to interface a Nextion display. The elements on the nextion display are built using the Nextion Editor software and uploaded to the display. The component can then interact with the display elements.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_API_Display_Nextion.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_API_Display_Nextion.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Handling Buttons
This example looks for button presses with IDs 1 and 2. On a button release event the corresponding LEDs will be toggled.
Macro reference
GetText
GetText | |
Gets the text of a specific item | |
- STRING | Name |
- STRING | Return |
GetTouchEvent
GetTouchEvent | |
Collects the next touch event in the queue. Returns 0 for no touch event detected, 1= touch press, 2 = touch release | |
- BYTE | Return |
GetTouchID
GetTouchID | |
Gets the ID of the corresponding touch event. Must be called after calling GetTouchEvent component macro. | |
- UINT | Return |
GetValue
GetValue | |
Gets the value from a specific item | |
- STRING | Name |
- ULONG | Return |
Initialise
Initialise | |
Sets up the UART connection to the Nextion display | |
- VOID | Return |
SetBackgroundColour
SetBackgroundColour | |
Sets the background colour of a specific item | |
- STRING | Name |
- ULONG | Colour |
- VOID | Return |
SetFontColour
SetFontColour | |
Sets the foreground font colour of a specific item | |
- STRING | Name |
- ULONG | Colour |
- VOID | Return |
SetPage
SetPage | |
Sets the page of the display allowing multiple configurations | |
- STRING | Name |
Name of the page e.g. "page0" | |
- VOID | Return |
SetText
SetText | |
Sets the text of a specific item | |
- STRING | Name |
- STRING | Text |
- VOID | Return |
SetValue
SetValue | |
Sets the numeric value of a specific item | |
- STRING | Name |
- ULONG | Number |
- VOID | Return |