Skip to content

Matrix: initialize _lastInterval when starting a sequence #468

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pennam
Copy link
Contributor

@pennam pennam commented May 13, 2025

The following sketch will display the first frame only for a few ms using core 1.4.1. Removing the delay(1200) from the sketch the first frame duration is correct. Initializing _lastInterval will make it work also with the delay.

#include "Arduino_LED_Matrix.h"

ArduinoLEDMatrix matrix;

const uint32_t snake[][4] = {
  { 0xffffffff, 0xffffffff, 0xffffffff, 1300 },
	{ 0x7fffffff, 0xffffffff, 0xfffff7ff, 66 },
	{ 0x3fe7ffff, 0xffffffff, 0xff7ff3fe, 66 },
	{ 0x1fc3fe7f, 0xfffffff7, 0xff3fe1fc, 66 },
	{ 0xf81fc3f, 0xe7ff7ff3, 0xfe1fc0f8, 66 },
	{ 0x500f81f, 0xc3fe3fe1, 0xfc0f8070, 66 },
	{ 0x500f, 0x81fc1fc0, 0xf8070020, 66 },
	{ 0x5, 0xf80f80, 0x70020000, 66 },
	{ 0x5, 0xa80880, 0x50020000, 600 },
	{ 0xd812, 0x41040880, 0x50020000, 200 },
	{ 0x5, 0xa80880, 0x50020000, 600 },
	{ 0xd812, 0x41040880, 0x50020000, 200 },
	
};
void setup() {
  Serial.begin(9600);
  while(!Serial){};

  matrix.begin();
  delay(1200);
  matrix.loadSequence(snake);
  matrix.play(true);
  Serial.println("start");

}

void loop() {
  // put your main code here, to run repeatedly:

}

@pennam pennam requested a review from andreagilardoni May 13, 2025 13:26
@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants