System API
Preview noticeβ
The MatrixOS Python API is in preview and is subject to change; it may contain errors.
Overviewβ
The System API in MatrixOS provides core system functions including timing, application management, device control, and system utilities. The System API is available as MatrixOS.SYS and is imported by default.
The Python System API is implemented in Applications/Python/PikaPython/MatrixOS_SYS.py with type hints in Applications/Python/PikaPython/_MatrixOS_SYS.pyi.
Version Informationβ
MatrixOS.SYS.GetVersionβ
def GetVersion() -> tuple
Returns the current MatrixOS version as a tuple of major, minor, and patch version numbers.
Returns:
tuple: A tuple containing (major, minor, patch) version numbers
Device Controlβ
MatrixOS.SYS.Rebootβ
def Reboot() -> None
Reboots the MatrixOS device. The device will restart and boot normally.
MatrixOS.SYS.Bootloaderβ
def Bootloader() -> None
Reboots the device into bootloader mode for firmware updates.
Timing Functionsβ
MatrixOS.SYS.DelayMsβ
def DelayMs(ms: int) -> None
Delays execution for the specified number of milliseconds.
Parameters:
ms(int): Delay duration in milliseconds
MatrixOS.SYS.Millisβ
def Millis() -> int
Returns the number of milliseconds since the device started.
Returns:
int: Milliseconds since boot
MatrixOS.SYS.Microsβ
def Micros() -> int
Returns the number of microseconds since the device started.
Returns:
int: Microseconds since boot
Application Managementβ
MatrixOS.SYS.OpenSettingβ
def OpenSetting() -> None
Opens the system settings application.
MatrixOS.SYS.ExecuteAPPβ
def ExecuteAPP(author: str, app_name: str, args: list = []) -> None
Launches an application by author and name with optional arguments.
Parameters:
author(str): Application author nameapp_name(str): Application nameargs(list, optional): Arguments to pass to the application (defaults to empty list)
MatrixOS.SYS.ExecuteAPPByIDβ
def ExecuteAPPByID(app_id: int, args: list = []) -> None
Launches an application by its ID with optional arguments.
Parameters:
app_id(int): Application ID numberargs(list, optional): Arguments to pass to the application (defaults to empty list)
Comments