====== LogicPython ====== LogicPython is a browser-based Python development environment for microcontrollers. The target device must be a microcontroller board device with LogicPython firmware installed. You can edit code, deploy to the device, run programs, monitor output, and use AI-assisted editing. ===== User Guide ===== * [[logicpython:getting_started|Getting Started]] - Setup checklist and basic workflow. * [[logicpython:first_program|First Program]] - Build your first blink project. * [[logicpython:running_on_device|Running on Device]] - Deploy, run, and stop programs. * [[logicpython:serial_monitor|Serial Monitor]] - View and manage runtime output. * [[logicpython:ai_assistant|AI Assistant]] - Request and review AI code edits. ===== CUBLOC API Reference ===== LogicPython includes a [[cubloc:index|CUBLOC]] API for those who wish to leverage their familiarity with the [[cubloc:index|CUBLOC]] platform. ==== Analog Input ==== * [[logicpython:cubloc_api:adin|ADIn]] - Read the full MicroPython ADC value from the specified ADC ''channel''. ==== Digital I/O ==== * [[logicpython:cubloc_api:high|High]] - Set a digital output ''pin'' high. * [[logicpython:cubloc_api:in|In]] - Read a digital input value from a ''pin''. * [[logicpython:cubloc_api:input|Input]] - Configure a ''pin'' as digital input. * [[logicpython:cubloc_api:low|Low]] - Set a digital output ''pin'' low. * [[logicpython:cubloc_api:out|Out]] - Write a digital output ''value'' to a ''pin''. * [[logicpython:cubloc_api:output|Output]] - Configure a ''pin'' as digital output. * [[logicpython:cubloc_api:reverse|Reverse]] - Toggle the output state of the specified ''pin''. ==== Memory and Storage ==== * [[logicpython:cubloc_api:eeread|EERead]] - Read data from a non-volatile memory. * [[logicpython:cubloc_api:eewrite|EEWrite]] - Write data to a non-volatile memory. ==== PWM ==== * [[logicpython:cubloc_api:pwm|Pwm]] - ''Output'' a PWM waveform on the specified ''channel''. * [[logicpython:cubloc_api:pwmoff|PwmOff]] - Stop PWM output on the specified ''channel''. ==== Modbus RTU Process ==== * [[logicpython:cubloc_api:setmodbus|SetModbus]] - Start the LogicPython Modbus RTU slave worker using a pre-opened UART ''channel''. ==== Stepper and Pulse Motion ==== * [[logicpython:cubloc_api:stepaccel|StepAccel]] - ''Output'' an accelerated pulse train on step ''channel'' 0 using a PIO state machine. * [[logicpython:cubloc_api:steppulse|StepPulse]] - ''Output'' a finite pulse train on the specified ''pin'' using a PIO state machine. * [[logicpython:cubloc_api:stepstat|StepStat]] - Return how many pulses have been generated by the most recent ''StepPulse'' or ''StepAccel'' command on the ''channel''. * [[logicpython:cubloc_api:stepstop|StepStop]] - Immediately stop pulse output on the specified step ''channel''.