Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Description
Lcd functions allow scripts to interact with the transmitter display. This access is limited to the 'run' functions of One-Time and Telemetry scripts. Widget scripts on the Horus (X10 and X12S) can make use of the lcd functions as well.
Notes:
The run function is periodically called when the screen is visible. In OpenTX 2.0 each invocation starts with a blank screen (unless lcd.lock() is used). Under OpenTX 2.1 screen state is always persisted across calls to the run function. Many scripts originally written for OpenTX 2.0 require a call to lcd.clear() at the beginning of their run function in order to display properly under 2.1 and 2.2.
Many of the lcd functions accept parameters named flags and patterns. The names and their meanings are described below.
0
normal font, default precision for numeric
DBLSIZE
double size font
MIDSIZE
mid sized font
SMLSIZE
small font
INVERS
inverted display
BLINK
blinking text
XXLSIZE
jumbo font
2.0.6
LEFT
left justify
2.0.6
Default for most functions not related to bitmaps
RIGHT
right justify
PREC1
single decimal place
PREC2
two decimal places
GREY_DEFAULT
grey fill
TIMEHOUR
dislay hours
Only for drawTimer
FORCE
pixels will be black
ERASE
pixels will be white
DOTTED
lines will appear dotted
LCD_W
width in pixels
LCD_H
height in pixels
X7
128
64
1 bit
X9D
212
64
4 bit
X9D+
212
64
4 bit
X9E
212
64
4 bit
X10
480
272
RGB565
X12S
480
272
RGB565
Draw a combo box
@status current Introduced in 2.0.0
x,y
(positive numbers) top left corner position
w
(number) width of combo box in pixels
list
(table) combo box elements, each element is a string
idx
(integer) index of entry to highlight
flags
(unsigned number) drawing flags, the flags can not be combined:
BLINK
combo box is expanded
INVERS
combo box collapsed, text inversed
0 or not present
combo box collapsed, text normal
none
Only available on Taranis
Draw a straight line on LCD
@status current Introduced in 2.0.0, flags introduced in 2.3.6
x1,y1
(positive numbers) starting coordinate
x2,y2
(positive numbers) end coordinate
pattern
SOLID or DOTTED
flags
lcdflags
none
If the start or the end of the line is outside the LCD dimensions, then the whole line will not be drawn (starting from OpenTX 2.1.5)
Draw a rectangle from top left corner (x,y) of specified width and height
@status current Introduced in 2.0.0, changed in 2.2.0
x,y
(positive numbers) top left corner position
w
(number) width in pixels
h
(number) height in pixels
flags
(unsigned number) drawing flags
t
(number) thickness in pixels, defaults to 1 (only on Horus)
none
Draw a text representation of switch at (x,y)
@status current Introduced in 2.0.0
x,y
(positive numbers) starting coordinate
switch
(number) number of switch to display, negative number displays negated switch
flags
(unsigned number) drawing flags, only SMLSIZE, BLINK and INVERS.
none
Draw a single pixel at (x,y) position
@status current Introduced in 2.0.0
x
(positive number) x position
y
(positive number) y position
flags
(optional) lcdflags
none
Taranis has an LCD display width of 212 pixels and height of 64 pixels. Position (0,0) is at top left. Y axis is negative, top line is 0, bottom line is 63. Drawing on an existing black pixel produces white pixel (TODO check this!)
Display a value formatted as time at (x,y)
@status current Introduced in 2.0.0, SHADOWED
introduced in 2.2.1
x,y
(positive numbers) starting coordinate
value
(number) time in seconds
flags
(unsigned number) drawing flags:
0 or not specified
normal representation (minutes and seconds)
TIMEHOUR
display hours
other general LCD flag also apply
SHADOWED
Horus only, apply a shadow effect
none
Draw a simple gauge that is filled based upon fill value
@status current Introduced in 2.0.0, changed in 2.2.0
x,y
(positive numbers) top left corner position
w
(number) width in pixels
h
(number) height in pixels
fill
(number) amount of fill to apply
maxfill
(number) total value of fill
flags
(unsigned number) drawing flags
none
Displays prevoiusly loaded bitmap at (x,y) and optionally scales it.
bitmap
bitmapPointer
x
integer
top coordinate
y
integer
left coordinate
scale
integer (0-100)
scale in percent ie. 50 divides size by two, 100 displays bitmap in original size, 200 doubles size.
none
Omitting scale draws image in 1:1 scale and is faster than specifying 100 for scale parameter.
2.3.0
Introduced
Clears the LCD screen optionaly filling it with selected color
color
integer (colorFlag)
none
This function works only in stand-alone and telemetry & widget scripts. See script types.
2.3.0
Introduced
Draws channel value defined in source variable at (x,y)
x
top coordinate
y
left coordinate
source
can be a source identifier (number) or a source name (string). See getValue()
flags
none
2.3.0
Introduced
Draw a text beginning at (x,y)
@status current Introduced in 2.0.0, SHADOWED
introduced in 2.2.1
x,y
(positive numbers) starting coordinate
text
(string) text to display
flags
(unsigned number) drawing flags. All values can be combined together using the + character. ie BLINK + DBLSIZE. See the for available characters in each font set.
0 or not specified
normal font
XXLSIZE
jumbo sized font
DBLSIZE
double size font
MIDSIZE
mid sized font
SMLSIZE
small font
INVERS
inverted display
BLINK
blinking text
SHADOWED
Horus only, apply a shadow effect
none
Display a number at (x,y)
@status current Introduced in 2.0.0, SHADOWED
introduced in 2.2.1
x,y
(positive numbers) starting coordinate
value
(number) value to display
flags
(unsigned number) drawing :
0 or not specified
display with no decimal (like abs())
PREC1
display with one decimal place (number 386 is displayed as 38.6)
PREC2
display with tow decimal places (number 386 is displayed as 3.86)
other general LCD also apply\
none
stored in variable pointer to a bitmap previously opened with
see
See
Draw a line only inside a rectangle
@status current Introduced in 2.4.0
x1,y1,x2,y1
(positive numbers) coordinates of the start and end of the unclipped line
xmin,xmax,ymin,ymax
(positive numbers) the limits of the rectangle inside which the line is drawn
pattern
(FORCE, ERASE, DOTTED) please see Lcd functions overview
none
Displays a bitmap pattern pie at (x,y)
@status current Introduced in 2.8.0
Parameters
bitmap
(pointer) point to a bitmap previously opened with Bitmap.open()
x,y
(positive numbers) starting coordinates
startAngle
Start angle
endAngle
End angle
flags
(optional) please see Lcd functions overview
Return value
none
Notice
Only available on Horus
Displays a bitmap pattern at (x,y)
@status current Introduced in 2.8.0
Parameters
bitmap
(pointer) point to a bitmap previously opened with Bitmap.open()
x,y
(positive numbers) starting coordinates
flags
(optional) please see Lcd functions overview
Return value
none
Notice
Only available on Horus
Invert a rectangle zone from top left corner (x,y) of specified width and height
@status current Introduced in 2.8.0
Parameters
x,y
(positive numbers) top left corner position
w
(number) width in pixels
h
(number) height in pixels
flags
(optional) please see Lcd functions overview
Return value
none
Set a color for specific area
@status current Introduced in 2.2.0
area
(unsigned number) specific screen area in the list bellow
CUSTOM_COLOR
DEFAULT_COLOR
DEFAULT_BGCOLOR
FOCUS_COLOR
FOCUS_BGCOLOR
LINE_COLOR
CHECKBOX_COLOR
MENU_BGCOLOR
MENU_COLOR
MENU_TITLE_DISABLE_COLOR
HEADER_COLOR
ALARM_COLOR
HIGHLIGHT_COLOR
TEXT_DISABLE_COLOR
HEADER_COLOR
DISABLE_COLOR
CURVE_CURSOR_COLOR
TITLE_BGCOLOR
TRIM_BGCOLOR
TRIM_SHADOW_COLOR
MAINVIEW_PANES_COLOR
MAINVIEW_GRAPHICS_COLOR
MENU_BGCOLOR
HEADER_ICON_BGCOLOR
HEADER_CURRENT_BGCOLOR
MAINVIEW_PANES_COLOR
MAINVIEW_GRAPHICS_COLOR
OVERLAY_COLOR
BARGRAPH1_COLOR
BARGRAPH2_COLOR
BARGRAPH_BGCOLOR
CUSTOM_COLOR
color
(number) color in 5/6/5 rgb format. The following prefined colors are available
WHITE
GREY
LIGHTGREY
DARKGREY
BLACK
YELLOW
BLUE
RED
DARKRED
none
Only available on Colorlcd radios
Raises a pop-up on screen that asks for confirmation
@status current Introduced in 2.2.0, changed from (title, event) to (title, message, event) in 2.3.8
title
(string) title to display
message
(string) text to display
event
(number) the event variable that is passed in from the Run function (key pressed)
"CANCEL"
user pushed EXIT key
Use only from stand-alone and telemetry scripts.
Raises a pop-up on screen that allows uses input
@status current Introduced in 2.0.0
title
(string) text to display
event
(number) the event variable that is passed in from the Run function (key pressed)
input
(number) value that can be adjusted by the +/- keys
min
(number) min value that input can reach (by pressing the - key)
max
(number) max value that input can reach
number
result of the input adjustment
"OK"
user pushed ENT key
"CANCEL"
user pushed EXIT key
Use only from stand-alone and telemetry scripts.
Draw text inside rectangle (x,y,w,h) with line breaks
x,y
(positive numbers) starting coordinate
w,h
(positive numbers) width and height of bounding rectangle
text
(string) text to display
flags
(optional) please see for drawing flags and colors, and for available characters in each font set. RIGHT, CENTER and VCENTER are not implemented.
x,y (integers) point where text drawing ended
2.5.0
Introduced
2.11.0
x,y return added
Raises a pop-up on screen that shows a warning
@status current Introduced in 2.2.0
title
(string) text to display
event
(number) the event variable that is passed in from the Run function (key pressed)
"CANCEL"
user pushed EXIT key
Use only from stand-alone and telemetry scripts.
Returns colorFlag in RGB565 format that can be used with lcd draw functions.
r
integer
number between 0 (0x00) and 255 (0xFF) that expresses te amount of red in the color
g
interer
number between (0x00) and 255 (0xFF) that expresses te amount of green in the color
b
integer
number between (0x00) and 255 (0xFF)that expresses te amount of blue in the color
or
rgb
integer
number between 0 (0x00) and 16777215 (0xFFFFFF) that expresses the RGB value (0xFF0000=RED, 0x00FF00=GREEN, 0x0000FF=BLUE)
color_flag
. See Drawing Flags
2.3.0
Introduced