Skip to content

Managing Data

Warning

Using slots can cause bootloops if the send command contains corrupted data. Before sending data to a slot, make sure that sending works correctly without using slots.

The device provides "slots" to store the text and image data. Data slots

Saving content (text or image) in these slots is done via the save_slot= argument in their respective commands. This allows for faster access and reduces the time needed to display the content on the LED matrix.

clear

Clears the ROM data on the device.

Note

This command removes all stored content from the device's memory, including device settings.

Source code in src/pypixelcolor/commands/clear.py
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
def clear():
    """
    Clears the ROM data on the device.

    Note:
        This command removes all stored content from the device's memory, including device settings.
    """
    cmd = bytes([
        4,     # Command length
        0,     # Reserved
        3,     # Command ID
        0x80,  # Command type ID
    ])
    return single_window_plan("clear", cmd)

show_slot

Shows the specified slot on the device.

Parameters:

Name Type Description Default
number int

The slot number to display.

required
Note

If the slot is empty, the device will cycle through available slots.

Source code in src/pypixelcolor/commands/show_slot.py
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
def show_slot(number: int):
    """
    Shows the specified slot on the device.

    Args:
        number: The slot number to display.

    Note:
        If the slot is empty, the device will cycle through available slots.
    """
    cmd = bytes([
        0x07,
        0x00,
        0x08,
        0x80,
        0x01,
        0x00,
        int(number) & 0xFF,
    ])
    return single_window_plan("show_slot", cmd)

delete

Delete a specific slot by its index.

Parameters:

Name Type Description Default
n int

Index of the slot to delete.

required
Source code in src/pypixelcolor/commands/delete.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
def delete(n: int):
    """
    Delete a specific slot by its index.

    Args:
        n: Index of the slot to delete.
    """
    if not (0 <= int(n) <= 255):
        raise ValueError("Slot index must be between 0 and 255")
    cmd = bytes([
        7,      # Command length
        0,      # Reserved
        2,      # Command ID
        1,      # Command type ID
        1,      # Reserved
        0,      # Reserved
        int(n)  # Slot index
    ])
    return single_window_plan("delete_slot", cmd)