Skip to content

Update led-matrix.md #1373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -395,54 +395,94 @@ To write more advanced sketches on your own, you may use the full API of the lib

## Members

**public ArduinoLEDMatrix()**
### `ArduinoLEDMatrix()`

Construct a new `LEDMatrix` object.
Construct a new LED matrix object. This will be used to access the methods in the library.

**public void autoscroll(int32_t interval_ms)**
```
ArduinoLEDMatrix LEDMatrix;
```


### `autoscroll()`

Enable autoscrolling through the frames in a sequence.


**Parameters**
* `interval_ms` Sets the time in milliseconds that should be spent on a frame before switching to the next frame in the sequence.

**public void begin()**
- `interval_ms` Sets the time in milliseconds that should be spent on a frame before switching to the next frame in the sequence.


### `begin()`

Starts the LED matrix.

**public void next()**
```arduino
LEDMatrix.begin()
```

### `next()`

Manually moves to the next frame in the sequence.

**public void loadFrame(const uint32_t buffer[3])**
```
LEDMatrix.next()
```

### `loadFrame()`

Loads a single frame that is not part of a sequence.

loads a single frame that is not part of a sequence.
```arduino
LEDMatrix.loadFrame(buffer[i])
```

**Parameters**
* `buffer[3]` an array of three 32bit integers, where each bit represents an LED.

**public void renderFrame(uint8_t frameNumber)**
- `buffer[3]` an array of three 32bit integers, where each bit represents an LED.

Render a specific frame from a sequence
### `renderFrame()`

**public void loadSequence(const uint32_t frames[][4])**
Render a specific frame from a sequence.

```
LEDMatrix.renderFrame(frameNumber)
```

**Parameters**

- `int` - frame to load.

### `loadSequence()`

Loads an animation sequence into the buffer but does not display it.

```arduino
LEDMatrix.frames[][4]
```

**Parameters**
* `frameNumber` Specifies which frame of the sequence should be rendered.

**public void play(bool loop)**
- `frameNumber` Specifies which frame of the sequence should be rendered.

### `play()`

Starts playing the loaded sequence.

```
LEDMatrix.play(state) //true or false
```

**Parameters**
* `loop` true to enable looping the sequence, false to play once.

**public bool sequenceDone()**
- `loop` true to enable looping the sequence, false to play once.

### `sequenceDone()`

Check for if the sequence is finished playing or if the frame should be advanced another step.

**Returns**
false if the sequence is not finished, true if it is.

- `false` if the sequence is not finished, `true` if it is.