From afedee898e25215fb66a73169b07b423a54800c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Hyl=C3=A9n?= Date: Thu, 21 Sep 2023 11:56:23 +0200 Subject: [PATCH 1/5] Update led matrix --- .../tutorials/led-matrix/led-matrix.md | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) 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..ad99f1137b 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,20 +381,21 @@ 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` [`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` [`loadSequence`](#)`(uint8_t *arr)` | Loads the pixels into the buffer but does not display them. +`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`](#)`)` | Sets the current frame to number 0 in the sequence. ## Members From 119fd1b0845624f210ebf0f2f1f11a9e3e14a270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Hyl=C3=A9n?= Date: Mon, 25 Sep 2023 16:40:39 +0200 Subject: [PATCH 2/5] Update API table --- .../tutorials/led-matrix/led-matrix.md | 51 +++++++------------ 1 file changed, 17 insertions(+), 34 deletions(-) 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 ad99f1137b..1d109de702 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,21 +381,18 @@ 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` [`loadSequence`](#)`(uint8_t *arr)` | Loads the pixels into the buffer but does not display them. -`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`](#)`)` | 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`](#)`(uint8_t *arr)` | Loads the pixels into the buffer but does not display them. +`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. ## Members @@ -410,20 +407,6 @@ 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 on(size_t pin)** - -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. - -**Parameters** -* `pin` Defines which LED should be turned off. Accepted values are 0-95. - **public void begin()** Starts the LED matrix. @@ -443,6 +426,10 @@ loads a single frame that is not part of a sequence. Render a specific frame from a sequence +**public void loadSequence(const uint8_t *arr[][4])** + +Sets the current frame to frame 0 in the sequence. + **Parameters** * `frameNumber` Specifies which frame of the sequence should be rendered. @@ -467,8 +454,4 @@ Loads the pixels into the frame but does not load them. **Parameters** * `arr` Pointer to an array that holds the frame -* `size` the amount of pixels in your frame. - -**public void loadWrapper(const uint32_t frames[][4], uint32_t howMany)** - -Sets the current frame to frame 0 in the sequence. \ No newline at end of file +* `size` the amount of pixels in your frame. \ No newline at end of file From de84076722d92d0ecc50a74cf4bca39a3cf83ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Hyl=C3=A9n?= Date: Mon, 25 Sep 2023 16:47:52 +0200 Subject: [PATCH 3/5] Update led-matrix.md --- .../tutorials/led-matrix/led-matrix.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) 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 1d109de702..434f3ab27c 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,18 +381,18 @@ 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` [`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`](#)`(uint8_t *arr)` | Loads the pixels into the buffer but does not display them. -`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. + 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. +`public void` [`loadPixels`](#)`(uint8_t *arr, size_t size)` | Loads the pixels into the buffer but does not display them. ## Members @@ -426,9 +426,9 @@ loads a single frame that is not part of a sequence. Render a specific frame from a sequence -**public void loadSequence(const uint8_t *arr[][4])** +**public void loadSequence(const uint32_t frames[][4])** -Sets the current frame to frame 0 in the sequence. + Loads an animation sequence into the buffer but does not display it. **Parameters** * `frameNumber` Specifies which frame of the sequence should be rendered. From 17028ee02636ec360fc175485b6c2b3a7523f3dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Hyl=C3=A9n?= Date: Tue, 26 Sep 2023 13:48:39 +0200 Subject: [PATCH 4/5] Update led-matrix.md --- .../uno-r4-wifi/tutorials/led-matrix/led-matrix.md | 9 --------- 1 file changed, 9 deletions(-) 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 434f3ab27c..4587712d6f 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 @@ -392,7 +392,6 @@ To write more advanced sketches on your own, you may use the full API of the lib `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. -`public void` [`loadPixels`](#)`(uint8_t *arr, size_t size)` | Loads the pixels into the buffer but does not display them. ## Members @@ -447,11 +446,3 @@ Check for if the sequence is finished playing or if the frame should be advanced **Returns** false if the sequence is not finished, true if it is. -**public void loadPixels(uint8_t arr, size_t size)** - -Loads the pixels into the frame but does not load them. - -**Parameters** -* `arr` Pointer to an array that holds the frame - -* `size` the amount of pixels in your frame. \ No newline at end of file From fc6730e3c93f1445305eab72c0a2938fe71ab21f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Fri, 29 Sep 2023 10:41:24 +0200 Subject: [PATCH 5/5] Update led-matrix.md --- .../tutorials/led-matrix/led-matrix.md | 74 ++++++++++++++----- 1 file changed, 57 insertions(+), 17 deletions(-) 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 4587712d6f..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 @@ -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.