functionconstructor

Inputs

TypeNameDefaultDescription
StringscriptPathPath of the user's .py script (empty string: main.py of the file system)
StringpythonHomePath of the embedded Python distribution (Resources/PythonRuntime)
BooleanaddScriptDirToPathAdds the folder of scriptPath to the Python module search path
StringlibraryPathOptional (empty string = disabled): .py file of a shared library - its folder is added to the search path
StringshimPathPath of the library's machine/time shim (Resources/Scripts/_shim/machine_time_shim.py), run before the user script
BooleanfsEnabledFile system enabled
StringfsSourceFolder of the initial file system, copied at each simulation (empty string = blank flash)
StringfsWorkspaceFolder where the timestamped copy of the file system is created (empty or relative: from the simulation folder)
BooleanfsOpenExplorerOpen Windows Explorer on the copy at the end of the simulation
StringinstanceNameInstance name (getInstanceName()), reused in the name of the copy
RealgpioOpTimeExecution time (s) of a pin access (Pin.value()/on()/off()); 0 = instantaneous accesses
RealhangWarningTimeReal (wall-clock) time (s) after which a warning is logged if the script does not let the simulation advance; 0 = never
BooleandebugEnabledWaits for VS Code (debugpy) at the start of the simulation, to debug the program
IntegerdebugPortLocal TCP port on which debugpy listens
Integer[:]pinIdsGPIO number of each pin index (e.g. {0, ..., 7, 25} for MCU)
Integer[size(pinIds, 1)]pinCapsCapabilities of each pin index, sum of 1 = digital, 2 = wired to a connector (UART, I2C), 4 = ADC input
StringboardProfileBoard profile read by the machine shim: "generic" (MCU) or "pico" (RPi_Pico)

Outputs

TypeNameDefaultDescription
PyRuntimehandle