Skip to main content

Debug Blocks

say (text)​

Sends a text line to the board's owner — the PC that receives the data stream — on UDP port 55153. It appears in the Serial Terminal.

The text can contain variables: write $name and it is replaced, when the block runs, by the current value of the variable name as a signed decimal number (for example -600). The variable must be declared in Setup, otherwise the program does not compile.

Debug
say"spike detected"
Debug
say"rms0=$rms0"

log variable​

Logs a variable's current integer value as a decimal string. Only the numeric value is sent — not the variable name.

Debug
log variablerms0

Combined Example​

Use say with $name to print a label and a value on one line, or log variable for the bare numeric value:

LOOP ~1 kHz
Acquisition
RMS getch0→rms0
Debug
say"rms0="
Debug
log variablerms0

Output on port 55153:

rms0=
412

Where to See Output​

Log messages appear in:

  1. The Serial Terminal panel inside the HMCLS app
  2. Any external UDP listener on port 55153:
receive_logs.py
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind(("0.0.0.0", 55153))
while True:
data, addr = s.recvfrom(256)
print(data.decode())