Make prototype readings readable before building a dashboard

When a prototype prints a stream of unlabeled numbers, its developer may understand them and everyone else has to guess. A useful first interface can be as simple as a clear label, a unit and an indication of whether the value is current.

The problem shows up in requests like this Arduino forum thread about combining environmental sensing, an LCD and a buzzer. Before designing a dashboard, make the data understandable in the terminal: readable telemetry is what a later screen, log file or review will be built on, and it depends on how the firmware formats text and keeps recent values. On our bench we checked the text and list operations such a log relies on, using the BIPES block editor on a Raspberry Pi Pico running MicroPython. The results include one real failure: an option the editor offered did not exist in the firmware on the board.

Build messages deliberately

Quoted text is a string. Joining combines fragments; appending adds text to an existing variable. Neither operation adds spaces or units for you. Two words joined directly print with no separator.

To include a numeric reading, convert it to text before joining it with a label. Keep the raw number separately for calculations. A formatted message such as "temperature: 24 C" is for people; it should not become the only remaining copy of the measurement.

Length checks need care. A string made of "Hi" and two non-ASCII characters reported a length of 4. That is the character count, not the UTF-8 byte count. If a serial receiver or a fixed-size buffer expects bytes, the two numbers differ.

Check positions against the actual output

A search returns a position or a no-match result. Searching for "0" in the string "125" returned -1. Do not pass that result straight into an indexing operation: in Python a negative index refers to a character counted from the end, so the code keeps running with the wrong value.

The editor's substring block also has its own convention. A displayed range of 2 through 5 became Python [2:6] and produced "lloW" from "HelloWorld". Reading the block as "second through fifth character" would predict a different result. Settle the convention with the generated code and a known test string before you rely on it.

The editor and the runtime did not agree

The block menu offered title case. Running it on the board raised an AttributeError for title(), while uppercase and lowercase worked. The menu and the MicroPython build on the board did not support the same set of string methods.

This is a small example of a common integration problem. Code that runs on desktop Python, or an option that appears in a tool, may not exist in the firmware build on the device. Test each operation on the target board, and record the firmware version with the project so the next person sees the same behavior.

Two more details matter for an unattended prototype. Trimming removes whitespace only at the chosen ends of a string, not in the middle. And a prompt block waits for terminal input. That pause is fine at a desk, but inside a loop on a standalone device it stops everything until someone types.

Keep several values together

A list keeps an ordered collection. In our checks, a list [1, 3, 5, 7] was created, a five-entry list was counted, and the two occurrences of 3 in a list were found at positions 1 and 3. Those positions follow zero-based indexing, which is worth stating whenever a person reads them.

The list operations differ in ways that matter for a short history of readings:

Joining builds text from list entries with a delimiter, and splitting reverses that for a suitable string. Both are simple ways to log or transmit a few values, provided the delimiter cannot appear inside a value.

A readable first log

For a prototype review, start with one readable line per reading: a label, the value, the unit, and whether the reading is fresh. Keep a small list of recent values that someone can inspect. Add a screen or a dashboard after the values and their meaning are stable; a graphical interface built on unclear data only makes the confusion look finished.