Skip to content
Draft
Show file tree
Hide file tree
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 @@ -5,7 +5,7 @@
* Initial author: Sebastian Romero (s.romero@arduino.cc)
*/

#include "Modulino_LED_Matrix.h"
#include <Arduino_Modulino.h>
#include "LEDMatrixGallery.h" // This header contains predefined animations for the LED matrix display.

ModulinoLEDMatrix matrix;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Initial author: Sebastian Romero (s.romero@arduino.cc)
*/

#include "Modulino_LED_Matrix.h"
#include <Arduino_Modulino.h>
#include "animation.h"

ModulinoLEDMatrix matrix;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
This example code is in the public domain.
*/

#include "Modulino.h"
#include "Modulino_LED_Matrix.h"
#include <Arduino_Modulino.h>
#include "LEDMatrixGallery.h"

ModulinoLEDMatrix matrix;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Initial author: Sebastian Romero (s.romero@arduino.cc)
*/

#include "Modulino_LED_Matrix.h"
#include <Arduino_Modulino.h>
#include "flames_animation.h"

/* Graphic in 4-bit grayscale */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Initial author: Sebastian Romero (s.romero@arduino.cc)
*/

#include "Modulino_LED_Matrix.h"
#include <Arduino_Modulino.h>

constexpr uint8_t animation[][16] = {
{ 0x00, 0x00, 0x00, 0x7c, 0x82, 0x82, 0x82, 0x82, 0x82, 0x7c, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

#include "ArduinoGraphics.h"
#include "Modulino_LED_Matrix.h"
#include <Arduino_Modulino.h>

ModulinoLEDMatrix matrix;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

#include "ArduinoGraphics.h"
#include "Modulino_LED_Matrix.h"
#include <Arduino_Modulino.h>

ModulinoLEDMatrix matrix;

Expand All @@ -16,10 +16,11 @@ ModulinoLEDMatrix matrix;
// Each frame needs space for pixels + duration.
// For Modulino 12x8, that's 12 bytes pixels + 4 bytes duration = 16 bytes.
constexpr size_t FRAMES = 128;
constexpr size_t FRAME_SIZE = ModulinoLEDMatrix::MONOCHROMATIC_ANIMATION_FRAME_SIZE;

// Frame buffers for the animations. This is where the captured frames will be stored.
uint8_t animation1Buffer[FRAMES][MONOCHROMATIC_ANIMATION_FRAME_SIZE];
uint8_t animation2Buffer[FRAMES][MONOCHROMATIC_ANIMATION_FRAME_SIZE];
uint8_t animation1Buffer[FRAMES][FRAME_SIZE];
uint8_t animation2Buffer[FRAMES][FRAME_SIZE];

// Variables to hold the actual used size of the buffers after capturing the animations.
// This is important because the captured animation might not use all the allocated space.
Expand Down Expand Up @@ -53,14 +54,14 @@ void prepareAnimations(){
Serial.print("Remaining bytes for animation 1: ");
Serial.println(sizeof(animation1Buffer) - animation1UsedBytes);
Serial.print("Frames captured for animation 1: ");
Serial.println(animation1UsedBytes / MONOCHROMATIC_ANIMATION_FRAME_SIZE);
Serial.println(animation1UsedBytes / FRAME_SIZE);

Serial.print("Bytes used for animation 2: ");
Serial.println(animation2UsedBytes);
Serial.print("Remaining bytes for animation 2: ");
Serial.println(sizeof(animation2Buffer) - animation2UsedBytes);
Serial.print("Frames captured for animation 2: ");
Serial.println(animation2UsedBytes / MONOCHROMATIC_ANIMATION_FRAME_SIZE);
Serial.println(animation2UsedBytes / FRAME_SIZE);
}

void setup() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "ArduinoGraphics.h"
#include "Modulino_LED_Matrix.h"
#include <Arduino_Modulino.h>

ModulinoLEDMatrix matrix;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* This example shows how to use the Modulino LED Matrix library to display
* basic graphics and animations on the Modulino LED Matrix display using the column-major order (vertical) mode.
* Frames in column-major order are more efficiently rendered on the LED matrix display, as they align with the way the display processes data.
*
* Initial author: Sebastian Romero (s.romero@arduino.cc)
*/

#include <Arduino_Modulino.h>
#include "LEDMatrixGalleryVertical.h" // This header contains predefined animations for the LED matrix display.

ModulinoLEDMatrix matrix;

void setup() {
if (!matrix.begin()) {
// If initialization fails, we enter an infinite loop and
// blink the built-in LED to indicate an error.
while (true){
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); // Blink built-in LED to indicate error
delay(500);
}
}

// Animations in column-major order require
// setting the display mode to MonochromaticVertical
matrix.setMode(DisplayMode::MonochromaticVertical);
}

void loop() {
// Play startup animation from gallery
matrix.setSequence(LEDMATRIX_ANIMATION_STARTUP_VERTICAL);
matrix.play();
delay(500);

// Show the UNO icon from the gallery
matrix.setFrame(LEDMATRIX_UNO_VERTICAL);
delay(1000);

// Clear the display
matrix.clear();
delay(500);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
* SPDX-License-Identifier: MPL-2.0
*/

#include <Arduino_Modulino.h>
#include "ArduinoGraphics.h"
#include <Arduino_Modulino.h>
#include "Arduino_LED_Matrix.h"

// Create a ModulinoThermo object
Expand Down
Loading
Loading