This is an old revision of the document!
LogicPython User Documentation
LogicPython is a browser-based Python development environment for RP2350 hardware.
The target device must be an RP2350-based device with LogicPython firmware installed.
You can edit code, deploy to the device, run programs, monitor output, and use AI-assisted editing.
User Guide
CUBLOC API Reference
The CUBLOC API pages are grouped by category. Each entry links to a dedicated page and includes a short description.
ADIn - Read the full MicroPython ADC value from the specified ADC
channel.
Digital I/O
High - Set a digital output
pin high.
In - Read a digital input value from a
pin.
Input - Configure a
pin as digital input.
Low - Set a digital output
pin low.
Out - Write a digital output
value to a
pin.
Output - Configure a
pin as digital output.
Reverse - Toggle the output state of the specified
pin.
Memory and Storage
EERead - Read bytes from per-
address backing files named like _ee_0000.
EEWrite - Write bytes into per-
address backing files named like _ee_0000.
PWM and Counters
Count - Return the current pulse count for the specified counter
channel.
CountReset - Reset the pulse count for the specified counter
channel to 0.
FreqOut -
Output a square-wave frequency on the specified PWM
channel.
Pwm -
Output a PWM waveform on the specified
channel.
PwmOff - Stop PWM output on the specified
channel.
Serial and Communication
BClr - Clear the RS-232 receive buffer, send buffer, or both buffers.
BFree - Return the number of free bytes in a receive or send buffer.
BLen - Return the number of bytes currently in a receive or send buffer.
CheckBf - Return the number of bytes waiting in the receive buffer without consuming them.
Get - Read up to 4 bytes from the receive buffer as a little-endian integer.
GetA - Read bytes into a mutable byte array.
GetA2 - Read bytes into a mutable byte array until a stop character is found.
GetCrc - Calculate the MODBUS RTU CRC-16 of a byte array slice.
GetStr - Read string data from the RS-232 receive buffer.
GetStr2 - Read string data until a stop character is encountered.
OpenCom - Enable serial communication on a CUBLOC-style
channel.
Put - Send an integer value as 1 to 4 little-endian bytes.
PutA - Send a byte
array on the specified RS-232
channel.
PutA2 - Send a byte
array until a stop character is encountered.
PutStr - Send string
data on the specified RS-232
channel.
SetModbus - Start the LogicPython Modbus RTU slave worker using a pre-opened UART
channel.
SetRS232 - Reconfigure an already-open RS-232
channel with a new baud rate and
protocol.
WaitTx -
Wait until the send buffer for the specified RS-232
channel is flushed.
Stepper and Pulse Motion
StepAccel -
Output an accelerated pulse train on step
channel 0 using a PIO state machine.
StepPulse -
Output a finite pulse train on the specified
pin using a PIO state machine.
StepStat - Return how many pulses have been generated by the most recent
StepPulse or
StepAccel command on the
channel.
StepStop - Immediately stop pulse output on the specified step
channel.
System and Debug
Debug - Print debug
values, interpreting CUBLOC debug control codes.
SetDebug - Enable or disable
Debug output.
SetOnGlobal - Enable or disable CUBLOC-style global interrupt handling.
Sys - Return a supported CUBLOC system status value.
Time - Read system RTC values for addresses 10 through 13.
Timing and Delays
Delay -
Delay execution for the given number of
milliseconds.
OnTimer - Register a periodic timer
callback using CUBLOC
OnTimer semantics.
Pause -
Pause execution for the given interval in
milliseconds.
SetOnTimer - Enable or disable execution of callbacks registered with
OnTimer.
UDelay -
Delay execution for the given number of
microseconds.
Wait -
Delay execution for the given interval in
milliseconds.