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.
This commit is contained in:
David Todd (c0de) 2018-07-24 21:23:32 -05:00
parent ae3a642e10
commit d042468344

View File

@ -246,18 +246,24 @@ void randChangePxl(int src[TOTALPXLS][3], int dst[TOTALPXLS][3], int dlytime, in
delay(dlytime); delay(dlytime);
} }
// Loop is at the bottom because Arduino started giving me undefined function errors... void setup(void) {
void loop() { matrix.begin();
uint32_t t; matrix.setBrightness(BRIGHTNESS);
while (((t = micros()) - prevTime) < (1000000L / MAX_FPS)); // FPS Limit?
prevTime = t;
showPxl(twitter, 1000); // Initialize our pixel structure
notifyPopupPxl(glogo, 500); for (int cnt = 0; cnt < TOTALPXLS; cnt++) {
notifyScrollPxl(upvote, 1000, 4); pixols[cnt].active = false;
notifyScrollPxl(mario, 1000); // Not specifying the loop will make it only show once pixols[cnt].id = cnt;
}
// This is supposed to be a random pixel fill transition, but // Bootup SH logo
// the rng does not guarentee unique numbers in the range automatically showPxl(sh, 1000);
randChangePxl(mario, pridec0de, 1000, 10); }
void loop() {
showPxl(twitter, 1000);
randChangePxl(twitter, ig, 1000, 20);
notifyScrollPxl(upvote, 1000, 2);
notifyPopupPxl(glogo, 1000);
notify
} }