diff --git a/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/led-matrix/led-matrix.md b/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/led-matrix/led-matrix.md index 179626cb03..f9125e94fe 100644 --- a/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/led-matrix/led-matrix.md +++ b/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/led-matrix/led-matrix.md @@ -381,93 +381,108 @@ Have fun creating interactive interfaces or animation on your UNO R4 WiFi! To write more advanced sketches on your own, you may use the full API of the library as found below. - Members | Descriptions ---------------------------------|--------------------------------------------- -`public ` [`ArduinoLEDMatrix`](#)`()` | The main class for controlling the LED matrix. -`public void` [`autoscroll`](#)`(int32_t interval_ms)` | Sets the time in ms for each frame to be displayed. -`public void` [`on`](#)`(size_t pin)` | Turn an individual pixel on. -`public void` [`off`](#)`(size_t pin)` | Turn an individual pixel off. -`public void` [`begin`](#)`()` | Start the LED matrix. -`public void` [`next`](#)`()` | Manually move to the next frame in the sequence. -`public void` [`loadFrame`](#)`(const uint32_t buffer[3])` | Load a new single frame that is not in any sequence. -`public void` [`renderFrame`](#)`(uint8:t frameNumber)` | Render the loaded frame. -`public void` [`play`](#)`(bool loop = false)` | Start playing the sequence of frames, with the option to loop indefinitely or play once. -`public bool` [`sequenceDone`](#)`()` | checks if the sequence has finished playing. -`public void` [`loadPixels`](#)`(uint8_t *arr, size_t size)` |Loads the pixels into the buffer but does not display them. -`public void` [`loadWrapper`](#)`(`[`const uint32_t frames[][4], uint32_t howMany`](#)` callback)` | Sets the current frame to number 0 in the sequence. + Members | Descriptions +---------------------------------------------------------------|--------------------------------------------- +`public ` [`ArduinoLEDMatrix`](#)`()` | The main class for controlling the LED matrix. +`public void` [`autoscroll`](#)`(int32_t interval_ms)` | Sets the time in ms for each frame to be displayed. +`public void` [`begin`](#)`()` | Start the LED matrix. +`public void` [`next`](#)`()` | Manually move to the next frame in the sequence. +`public void` [`loadFrame`](#)`(const uint32_t buffer[3])` | Load a new single frame that is not in any sequence. +`public void` [`renderFrame`](#)`(uint8:t frameNumber)` | Render the loaded frame. +`public void` [`loadSequence`](#)`(const uint32_t frames[][4])`| Loads an animation sequence into the buffer but does not display it. +`public void` [`play`](#)`(bool loop = false)` | Start playing the sequence of frames, with the option to loop indefinitely or play once. +`public bool` [`sequenceDone`](#)`()` | checks if the sequence has finished playing. ## 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)** - -Enable autoscrolling through the frames in a sequence. +``` +ArduinoLEDMatrix LEDMatrix; +``` -**Parameters** -* `interval_ms` Sets the time in milliseconds that should be spent on a frame before switching to the next frame in the sequence. +### `autoscroll()` -**public void on(size_t pin)** +Enable autoscrolling through the frames in a sequence. -Turn on an individual LED. **Parameters** -* `pin` Defines which LED should be turned on. Accepted values are 0-95. -**public void off(size_t pin)** -Turn off an individual LED. +- `interval_ms` Sets the time in milliseconds that should be spent on a frame before switching to the next frame in the sequence. -**Parameters** -* `pin` Defines which LED should be turned off. Accepted values are 0-95. -**public void begin()** +### `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. + +### `renderFrame()` + +Render a specific frame from a sequence. -Render a specific frame from a sequence +``` +LEDMatrix.renderFrame(frameNumber) +``` **Parameters** -* `frameNumber` Specifies which frame of the sequence should be rendered. -**public void play(bool loop)** +- `int` - frame to load. -Starts playing the loaded sequence. +### `loadSequence()` -**Parameters** -* `loop` true to enable looping the sequence, false to play once. + Loads an animation sequence into the buffer but does not display it. -**public bool sequenceDone()** +```arduino +LEDMatrix.frames[][4] +``` -Check for if the sequence is finished playing or if the frame should be advanced another step. +**Parameters** -**Returns** -false if the sequence is not finished, true if it is. +- `frameNumber` Specifies which frame of the sequence should be rendered. -**public void loadPixels(uint8_t arr, size_t size)** +### `play()` -Loads the pixels into the frame but does not load them. +Starts playing the loaded sequence. + +``` +LEDMatrix.play(state) //true or false +``` **Parameters** -* `arr` Pointer to an array that holds the frame -* `size` the amount of pixels in your frame. +- `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** -**public void loadWrapper(const uint32_t frames[][4], uint32_t howMany)** +- `false` if the sequence is not finished, `true` if it is. -Sets the current frame to frame 0 in the sequence. \ No newline at end of file