mirror of
https://github.com/alopexc0de/pixopixel.git
synced 2024-12-25 22:42:40 +00:00
Add popup notification
This scrolls an image up into view, and back down out of view after the delay
This commit is contained in:
parent
2035272b51
commit
2a3d075a81
@ -40,6 +40,7 @@ void loop() {
|
||||
prevTime = t;
|
||||
|
||||
showImage(twitter, 1000);
|
||||
notifyPopupImg(glogo, 500);
|
||||
/*
|
||||
* showImage, displays an image to the display with no animation
|
||||
* args:
|
||||
@ -59,4 +60,40 @@ void showImage(int img[256][3], int dlytime) {
|
||||
matrix.fillScreen(0);
|
||||
matrix.show();
|
||||
}
|
||||
|
||||
// Notification functions
|
||||
|
||||
/*
|
||||
* notifyPopupImg, draws an image that scrolls into view, and back down
|
||||
* args:
|
||||
* - img[256][3] - Standard Pixo-Style icon
|
||||
* - dlytime - The amount of time (in ms) to keep the image on the display
|
||||
*/
|
||||
void notifyPopupImg(int img[256][3], int dlytime) {
|
||||
for (int j = 15; j >= 0; j--) {
|
||||
matrix.fillScreen(0);
|
||||
for (int i = 0; i < 256; i++) {
|
||||
matrix.setPixelColor(i + (j * 16),
|
||||
img[i][0], img[i][1], img[i][2]);
|
||||
}
|
||||
matrix.show();
|
||||
delay(50);
|
||||
}
|
||||
|
||||
delay(dlytime);
|
||||
|
||||
for (int j = 0; j <= 16; j++) {
|
||||
matrix.fillScreen(0);
|
||||
for (int i = 0; i < 256; i++) {
|
||||
matrix.setPixelColor(i + (j * 16),
|
||||
img[i][0], img[i][1], img[i][2]);
|
||||
}
|
||||
matrix.show();
|
||||
delay(50);
|
||||
}
|
||||
|
||||
delay(100);
|
||||
matrix.fillScreen(0);
|
||||
matrix.show();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user