Hi guys’
While im very slowly figuring out how to do gifs on the teensy flash i wanted to try using bitmaps to display an animation. I added the below to the BITMAP example and it does work displaying 5 animated 16x16 color bitmaps going from right to left accross the screen in a line following one another, it however is painfully slow. What ive done im sure is a dodgy way to do it so that may well be why it is slow or im just doing it wrong. Any suggestions on how to improve would be very welcome… The slow down was gradual as i added each separate bitmap as with one animated 16x16 bitmap alone the speed was way to fast requiring delays…
` void BITMAP() {
matrix.setBrightness(30);
int x, y;
x = 64;
y = 12;
while (x > -82) {
drawBitmap(x,y,&yellowframe1left);
dackgroundLayer.swapBuffers();
drawBitmap(x+25,y,&redleftframe1);
backgroundLayer.swapBuffers();
drawBitmap(x+40,y,&pinkleftframe2);
backgroundLayer.swapBuffers();
drawBitmap(x+55,y,&blueleftframe1);
backgroundLayer.swapBuffers();
drawBitmap(x+70,y,&orangeleftframe2);
backgroundLayer.swapBuffers();
//delay(20);
x = x-1;
drawBitmap(x,y,&yellowframe1left);
backgroundLayer.swapBuffers();
drawBitmap(x+25,y,&redleftframe1);
backgroundLayer.swapBuffers();
drawBitmap(x+40,y,&pinkleftframe2);
backgroundLayer.swapBuffers();
drawBitmap(x+55,y,&blueleftframe1);
backgroundLayer.swapBuffers();
drawBitmap(x+70,y,&orangeleftframe2);
backgroundLayer.swapBuffers();
//delay(20);
x = x-1;
drawBitmap(x,y,&yellowframe2left);
backgroundLayer.swapBuffers();
drawBitmap(x+25,y,&redleftframe2);
backgroundLayer.swapBuffers();
drawBitmap(x+40,y,&pinkleftframe1);
backgroundLayer.swapBuffers();
drawBitmap(x+55,y,&blueleftframe2);
backgroundLayer.swapBuffers();
drawBitmap(x+70,y,&orangeleftframe1);
backgroundLayer.swapBuffers();
//delay(20);
x = x-1;
drawBitmap(x,y,&yelloframe2left);
backgroundLayer.swapBuffers();
drawBitmap(x+25,y,&redleftframe2);
backgroundLayer.swapBuffers();
drawBitmap(x+40,y,&pinkleftframe1);
backgroundLayer.swapBuffers();
drawBitmap(x+55,y,&blueleftframe2);
backgroundLayer.swapBuffers();
drawBitmap(x+70,y,&orangeleftframe1);
backgroundLayer.swapBuffers();
//delay(20);
x = x-1;
drawBitmap(x,y,&yellowframe3);
backgroundLayer.swapBuffers();
drawBitmap(x+25,y,&redleftframe2);
backgroundLayer.swapBuffers();
drawBitmap(x+40,y,&pinkleftframe1);
backgroundLayer.swapBuffers();
drawBitmap(x+55,y,&blueleftframe2);
backgroundLayer.swapBuffers();
//delay(20);
drawBitmap(x+70,y,&orangeleftframe1);
backgroundLayer.swapBuffers();
x = x-1;
drawBitmap(x,y,&yellowframe3);
backgroundLayer.swapBuffers();
drawBitmap(x+25,y,&redleftframe2);
backgroundLayer.swapBuffers();
drawBitmap(x+40,y,&pinkleftframe1);
backgroundLayer.swapBuffers();
//delay(200);
drawBitmap(x+55,y,&blueleftframe2);
backgroundLayer.swapBuffers();
drawBitmap(x+70,y,&orangeleftframe1);
backgroundLayer.swapBuffers();
x = x-1;
}
delay(1000);
backgroundLayer.fillScreen({0,0,0});
}
`