> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oryx.mechatronstudio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Digital format

> One row per state change: how to read the .txt of a digital signal.

The digital file holds **one row per change**. Between one row and the next the
outputs stay as they are, so a thousand-step signal usually fits in a few dozen
rows.

## Structure

```
Step  CLK  DATA  EN
1     0    0     0
3     1    0     0
4     1    1     0
7     0    1     1
16    0    1     1
```

* The **first column** is the step where the change happens.
* The rest are the **value of each channel**, in timeline order, with the channel
  name as the header.

## Reading rules

<AccordionGroup>
  <Accordion title="Only changes are written">
    A new row appears only if some channel changed value. Repeating the previous
    state would add nothing.
  </Accordion>

  <Accordion title="The total length travels in the last row">
    If the last change happened before the end, a row is added with the final
    step and the values still in force. That way the total length is inside the
    table and not a separate piece of data.
  </Accordion>

  <Accordion title="Steps can be fractional">
    A divided channel produces rows at positions like `3.333333`. They are
    written with up to six decimals.
  </Accordion>

  <Accordion title="Each channel only contributes its own sub-steps">
    A channel split into thirds and another into quarters do not share a grid. At
    a time point that is not its own, a channel **carries forward its last known
    value** instead of being read at a position it does not have.
  </Accordion>
</AccordionGroup>

## With metadata

At the end of the file, after a blank line:

```
VOLTAGE: 5
STEP_TIME (us): 100
CYCLES (RPM): 0
```

## How to play it back

The idea is straightforward: read a row, set the outputs to those values, wait
until the step of the next row, and repeat.

The time per step comes from `STEP_TIME` if you exported the metadata; otherwise
you set it in the code.

The full example, reading from a microSD card, is in
[Generate the signal with an ESP32](/en/export/esp32-microsd).
