Skip to content

10011: Draw Element ​

Draw an element

Payload ​

FieldNameDescriptionTypeUnit
3Page IDThe page to draw or update.
Page ids 0-10 are reserved for system use.
If no page id is provided, page id 11 will be assumed.
uint8
5Status bar EnableShow the status barbool
6Redraw TypePossible values:
  • 0: Auto— Automatically choose the redraw type
  • 1: PartialRedraw— Only redraw the parts of the screen changed in this message
  • 2: FullRedraw— Clear the screen buffer, and redraw the entire screen
  • 3: BufferOnly— Update the buffer only, do not redraw
  • 4: FullRedrawWithoutClear— Redraw the entire screen, without clearing the buffer
  • 5: ClearDontDraw— Clear the screen buffer, but don't redraw
uint8
7XX coordinate for the start of the element. If padded, this is the start of the padded area.uint
8YY coordinate for the start of the element. If padded, this is the start of the padded area.uint
9WidthWidth of the element. If padded this does not include the padding.uint
10HeightHeight of the element. If padded this does not include the padding.uint
11TypeType of element to draw
Possible values:
  • 0: Box— Draw a Box. Requires x, y (top left corner), width and height. Can include style, and padding Can include text and a font size and alignment. Can have corners rounded with the radius parameter. Can have a border with the line width parameter.
  • 1: Circle— Draw a circle. Requires x, y (top left corner) and width. Can have a border with the line width parameter.
  • 2: Line— Draw a line. Requires x, y (start point), width and height (end point). Can have line width and line type (dashed or solid).
  • 3: Bitmap— Draw a bitmap, from provided data. Requires x, y (top left corner), width, height and bitmap data.
uint8
12StyleStyle of the element to draw. Default is BlackOnClear.
Possible values:
  • 0: BlackOnClear
  • 1: WhiteOnBlack
  • 2: BlackOutline
  • 3: WhiteOutline
uint8
13FontSizeSize of the font to use. Default is Medium.
Possible values:
  • 0: Small
  • 1: Medium
  • 2: Large
uint8
14TextAlignAlignment of the text. Default is Middle.
Possible values:
  • 0: Left
  • 1: Middle
  • 2: Right
uint8
15LineWidthDefault is 1. Max is 8.uint8
16PaddingPadding inside the element (in terms of x and y). Default is 0.uint8
17RadiusFor use with circle, or corner rounding. Default is 0.uint8
18LineTypeDefault is Solid.
Possible values:
  • 0: Solid
  • 1: Dashed
uint8
19X2Second X coordinate, primarily for lines. Min 0, Max WIDTH -1.uint
20Y2Second Y coordinate, primarily for lines. Min 0, Max HEIGHT -1.uint
25Bitmapbytes
100Textascii

Element types ​

Box ​

Box with text ​

Line ​

Circle ​

Bitmap ​

Examples ​

Draw circle in the middle of a page
Protocol
3
3
Length
350
35 bytes
Type
2739
10011 (Draw Element)
Header Count
10
1
Header Types
1
1
Message ID
41000
1
Payload Count
60
6
Payload Types
57891011
5, 7, 8, 9, 10, 11
Status bar Enable
10
false
X
1115
115
Y
151
51
Width
120
20
Height
120
20
Type
11
1 (Circle)
Checksum
18150
12981
Draw a horizontal line across the middle of the page
Protocol
3
3
Length
350
35 bytes
Type
2739
10011 (Draw Element)
Header Count
10
1
Header Types
1
1
Message ID
41000
1
Payload Count
60
6
Payload Types
578111920
5, 7, 8, 11, 19, 20
Status bar Enable
10
false
X
10
0
Y
161
61
Type
12
2 (Line)
X2
1249
249
Y2
161
61
Checksum
0150
38400
Draw a 40x40 lightbug logo in the top left of the screen
Protocol
3
3
Length
2370
237 bytes
Type
2739
10011 (Draw Element)
Header Count
10
1
Header Types
1
1
Message ID
41000
1
Payload Count
70
7
Payload Types
5789101125
5, 7, 8, 9, 10, 11, 25
Status bar Enable
10
false
X
10
0
Y
10
0
Width
140
40
Height
140
40
Type
13
3 (Bitmap)
Bitmap
2000000032552552551921525525525524031255255255248632552552552521272552552552521272552552552541272552552552541272552552552541272550255254127252063254127252063254127255231
0,0,0,0,0,3,255,255,255,192,15,255,255,255,240,31,255,255,255,248,63,255,255,255,252,127,255,255,255,252,127,255,255,255,254,127,255,255,255,254,127,255,255,255,254,127,255,0,255,254,127,252,0,63,254,127,252,0,63,254,127,255,231,255,254,127,255,255,255,254,127,252,24,63,254,127,252,24,63,254,127,252,24,63,254,127,252,24,63,254,127,252,24,63,254,127,252,24,63,254,127,252,24,63,254,127,252,24,63,254,127,252,24,63,254,127,252,24,63,254,127,252,24,63,254,127,252,24,63,254,127,252,24,63,254,127,252,24,63,254,127,252,24,63,254,127,252,24,63,254,127,252,24,63,254,127,255,255,255,254,127,255,255,255,254,127,255,255,255,254,63,255,255,255,252,63,255,255,255,252,31,255,255,255,248,15,255,255,255,240,3,255,255,255,192,0,0,0,0,0
Checksum
120140
35960
Write the string "Lightbug..." in the top left of the screen in a box
Protocol
3
3
Length
450
45 bytes
Type
2739
10011 (Draw Element)
Header Count
10
1
Header Types
1
1
Message ID
41000
1
Payload Count
60
6
Payload Types
357811100
3, 5, 7, 8, 11, 100
Page ID
1129
129
Status bar Enable
10
false
X
10
0
Y
10
0
Type
10
0 (Box)
Text
117610510310411698117103464646
Lightbug...
Checksum
8249
12626

Code ​

For convenience, the following constants can be used to reference this message type.