Skip to content

OLED charts: add value to list (internal_oled_data_add)

What it does: Adds a new value to a data list, restricts it to the selected range, and maintains the maximum length of the list.

internal_oled_data_add

Inputs

  • VAL: value of type Value.
  • MAXLEN: value of type Value.
  • list LIST: parameter selection in the block menu.
  • list RANGE: parameter selection in the block menu.

Output

  • None (statement block).

When to use it

  • When you continuously collect data for a chart while the program is running.
  • Typically once per measurement period before graphing.

Tips and pitfalls

  • The value is converted to a number, limited to the selected range, and then normalized to 0-100.
  • With MAXLEN > 0, the oldest elements are removed after overflow (sliding window).

Generated Python example

chart_data_0 = chart_data_add(chart_data_0, 42, 0, 100, 64)