From d0424683446186720b72e8532ad799f1ec1bd1d5 Mon Sep 17 00:00:00 2001 From: "David Todd (c0de)" Date: Tue, 24 Jul 2018 21:23:32 -0500 Subject: [PATCH] Updated example usage of the functions The scrolling animations appear to have broken in the second stage, where the image is scrolling out of view. --- FIRMWARE/pixo-display/pixo-display-helper.ino | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/FIRMWARE/pixo-display/pixo-display-helper.ino b/FIRMWARE/pixo-display/pixo-display-helper.ino index ddffedc..4875ae5 100644 --- a/FIRMWARE/pixo-display/pixo-display-helper.ino +++ b/FIRMWARE/pixo-display/pixo-display-helper.ino @@ -246,18 +246,24 @@ void randChangePxl(int src[TOTALPXLS][3], int dst[TOTALPXLS][3], int dlytime, in delay(dlytime); } -// Loop is at the bottom because Arduino started giving me undefined function errors... +void setup(void) { + matrix.begin(); + matrix.setBrightness(BRIGHTNESS); + + // Initialize our pixel structure + for (int cnt = 0; cnt < TOTALPXLS; cnt++) { + pixols[cnt].active = false; + pixols[cnt].id = cnt; + } + + // Bootup SH logo + showPxl(sh, 1000); +} + void loop() { - uint32_t t; - while (((t = micros()) - prevTime) < (1000000L / MAX_FPS)); // FPS Limit? - prevTime = t; - showPxl(twitter, 1000); - notifyPopupPxl(glogo, 500); - notifyScrollPxl(upvote, 1000, 4); - notifyScrollPxl(mario, 1000); // Not specifying the loop will make it only show once - - // This is supposed to be a random pixel fill transition, but - // the rng does not guarentee unique numbers in the range automatically - randChangePxl(mario, pridec0de, 1000, 10); + randChangePxl(twitter, ig, 1000, 20); + notifyScrollPxl(upvote, 1000, 2); + notifyPopupPxl(glogo, 1000); + notify } \ No newline at end of file