For the complete documentation index, see llms.txt. This page is also available as Markdown.

OLED display built-ins

The Zen OLED is 128 x 64 monochrome pixels. Valid coordinates are X 0..127 and Y 0..63. Draw only when a screen or value changes; repeated full-screen work in every VM cycle can make the script unresponsive.

cls_oled

Compiler category: Leds Backing opcode: clsOled

Fills the complete display with one color.

Syntax

cls_oled(color);

Parameters

  • color: OLED_BLACK (0) or OLED_WHITE (1).

Returns

Nothing.

Example

init {
    cls_oled(OLED_BLACK);
}

pixel_oled

Compiler category: Console I/O Functions Backing opcode: pixelOled

Sets one pixel.

Syntax

Parameters

  • x: 0..127.

  • y: 0..63.

  • color: OLED_BLACK or OLED_WHITE.

Returns

Nothing.

Example


line_oled

Compiler category: Console I/O Functions Backing opcode: lineOled

Draws a line between two points.

Syntax

Parameters

  • x, to_x: 0..127.

  • y, to_y: 0..63.

  • thickness: 1..127.

  • color: OLED_BLACK or OLED_WHITE.

Returns

Nothing.

Example


rect_oled

Compiler category: Console I/O Functions Backing opcode: rectOled

Draws a rectangle outline or a filled rectangle.

Syntax

Parameters

  • x: 0..127.

  • y: 0..63.

  • width: 1..128.

  • height: 1..64.

  • fill: TRUE for filled or FALSE for outline.

  • color: OLED_BLACK or OLED_WHITE.

Returns

Nothing.

Example

Keep the full rectangle within the display: x + width <= 128 and y + height <= 64.


circle_oled

Compiler category: Console I/O Functions Backing opcode: circleOled

Draws a circle outline or a filled circle.

Syntax

Parameters

  • x: center X, 0..127.

  • y: center Y, 0..63.

  • radius: 1..63.

  • fill: TRUE or FALSE.

  • color: OLED_BLACK or OLED_WHITE.

Returns

Nothing.

Example

Choose a center and radius that do not push the intended drawing outside the screen.


putc_oled

Compiler category: Leds Backing opcode: putcOled

Writes one ASCII/glyph byte into the OLED text buffer. It does not draw until puts_oled is called.

Syntax

Parameters

  • position: buffer position 1..18 on the current 32-bit target.

  • ascii_code: supported byte 32..136.

Returns

Nothing.

Example


puts_oled

Compiler category: Leds Backing opcode: putsOled

Draws buffered characters using a built-in OLED font.

Syntax

Parameters

  • x: 0..127.

  • y: 0..63.

  • font: OLED_FONT_SMALL, OLED_FONT_MEDIUM, or OLED_FONT_LARGE.

  • length: 1..18 on the current 32-bit target.

  • color: OLED_BLACK or OLED_WHITE.

Returns

Nothing.

Example

The large font cannot render every special glyph. Compile and device-test the selected byte/font combination.


image_oled

Compiler category: Console I/O Functions Backing opcode: imageOled

Draws a packed monochrome const image record.

Syntax

Parameters

  • x: 0..127.

  • y: 0..63.

  • color: OLED_BLACK or OLED_WHITE.

  • clear_background: TRUE to clear the image rectangle before drawing.

  • image_address: addr(ImageName) or a valid image-row address.

Returns

Nothing.

Example

The data begins with width and height, followed by exactly ceil(width * height / 8) packed pixel bytes.


print

Compiler category: Leds Backing opcode: printf

Draws a const string using a built-in font. print is the current 32-bit name; printf is retained only as a deprecated compatibility alias.

Syntax

Parameters

  • x: 0..127.

  • y: 0..63.

  • font: OLED_FONT_SMALL, OLED_FONT_MEDIUM, or OLED_FONT_LARGE.

  • color: OLED_BLACK or OLED_WHITE.

  • string_address: addr(StringName) or a valid string-row address.

Returns

Nothing.

Example

Use a declared const string; a bare string literal is not a runtime address argument.


Custom button badge example

This builds a reusable visual button from a circle and one buffered character. Keep drawing separate from menu state mutation so viewing a page cannot accidentally change or save settings.

Back to the additional built-in index

Last updated