Skip to content

Text (base font) (fb_txt)

What it does: Draws text in the basic font of the fbuf.text(...) function at the specified coordinates.

fb_txt

Inputs

  • text: value of type Text.
  • px: X coordinate of the upper left corner - integer.
  • py: Y coordinate of the upper left corner - integer.
  • color: Color (0 - black, 1 - white).

Output

  • None (statement block).

When to use it

  • When you want to quickly display labels, numbers or diagnostics.
  • For common texts where the standard font size is sufficient.

Tips and pitfalls

  • Text input is generated as str(...) so numbers/booleans are output as text.
  • Long text is trimmed at the edges according to the size of the framebuffer; after drawing do oded_refresh.

Usage example

example_oled_dsiplay

Open example in ESP IDE

Generated Python example

fbuf.text(str(text), int(0), int(0), int(0))