Making Animations

Hello everybody, I am making a simple coin flip animation. This is what I’ve made so far, my question is: is there a better way of doing this? I like cartoons and I have a feeling that I’m going to use a lot of animations - probably to my detriment.

Anyways, here’s the code I’ve made so far.

    #include <Arduboy2.h>
    Arduboy2 arduboy;

    //all coin flipping frames
    const uint8_t coinFrames[] PROGMEM
    {
      //width, height
      56, 56,

      //frame0
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xe0, 0xf0, 0x78, 0xb8, 0xbc, 0xdc, 0xdc, 0xee, 0xee, 0xee, 0xee, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xee, 0xee, 0xee, 0xee, 0xdc, 0xdc, 0xbc, 0xb8, 0x78, 0xf0, 0xe0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xe0, 0xf8, 0x7c, 0xbe, 0xcf, 0xf7, 0xfb, 0xfd, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfd, 0xfb, 0xf7, 0xcf, 0xbe, 0x7c, 0xf8, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0x80, 0xf8, 0xff, 0x7f, 0x87, 0xf9, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xf9, 0x87, 0x7f, 0xff, 0xf8, 0x80, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x01, 0x1f, 0xff, 0xfe, 0xe1, 0x9f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x9f, 0xe1, 0xfe, 0xff, 0x1f, 0x01, 0x00, 0x00, 0x00, 0x03, 0x07, 0x1f, 0x3e, 0x7d, 0xf3, 0xef, 0xdf, 0xbf, 0x7f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x7f, 0xbf, 0xdf, 0xef, 0xf3, 0x7d, 0x3e, 0x1f, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x07, 0x0f, 0x1e, 0x1d, 0x3d, 0x3b, 0x3b, 0x77, 0x77, 0x77, 0x77, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0x77, 0x77, 0x77, 0x77, 0x3b, 0x3b, 0x3d, 0x1d, 0x1e, 0x0f, 0x07, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

      //frame1
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0x78, 0xb8, 0xbc, 0xdc, 0xde, 0xee, 0xee, 0xef, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xef, 0xef, 0xef, 0xdf, 0xdd, 0xbd, 0xba, 0x7a, 0xf4, 0xe8, 0xd0, 0xa0, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf0, 0xfc, 0x3e, 0xdf, 0xe7, 0xfb, 0xfd, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfd, 0xfb, 0xe7, 0xdf, 0x3e, 0xfd, 0xf2, 0xec, 0x10, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xfc, 0xff, 0x7f, 0x87, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x87, 0x7f, 0xff, 0xfc, 0xc3, 0x3c, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x3f, 0xff, 0xfe, 0xe1, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xe1, 0xfe, 0xff, 0x3f, 0xc3, 0x3c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0f, 0x3f, 0x7c, 0xfb, 0xe7, 0xdf, 0xbf, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xbf, 0xdf, 0xe7, 0xfb, 0x7c, 0xbf, 0x4f, 0x37, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1e, 0x1d, 0x3d, 0x3b, 0x7b, 0x77, 0x77, 0xf7, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xf7, 0xf7, 0xf7, 0xfb, 0xbb, 0xbd, 0x5d, 0x5e, 0x2f, 0x17, 0x0b, 0x05, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

      //frame2
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0x78, 0xbc, 0xdc, 0xde, 0xee, 0xef, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xef, 0xef, 0xdf, 0xdd, 0xbd, 0x7a, 0xf4, 0xe8, 0xd0, 0xa0, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0xfc, 0x7f, 0x8f, 0xf7, 0xf9, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xf9, 0xf7, 0x8f, 0x7f, 0xfc, 0xf3, 0xcc, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xfe, 0xff, 0x7f, 0x81, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x81, 0x7f, 0xff, 0xfe, 0xc1, 0x3e, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x7f, 0xff, 0xfe, 0x81, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x81, 0xfe, 0xff, 0x7f, 0x83, 0x7c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0f, 0x3f, 0xfe, 0xf1, 0xef, 0x9f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x9f, 0xef, 0xf1, 0xfe, 0x3f, 0xcf, 0x33, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1e, 0x3d, 0x3b, 0x7b, 0x77, 0xf7, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xf7, 0xf7, 0xfb, 0xbb, 0xbd, 0x5e, 0x2f, 0x17, 0x0b, 0x05, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

      //frame3
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xf0, 0x78, 0xbc, 0xde, 0xee, 0xef, 0xf7, 0xf7, 0xf7, 0xf7, 0xef, 0xef, 0xdf, 0xbd, 0x79, 0xf6, 0xc4, 0xa8, 0x30, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf0, 0xfe, 0x1f, 0xe3, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xe3, 0x1f, 0xfe, 0xf1, 0x89, 0x4e, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x3f, 0xff, 0xe0, 0x12, 0x9f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0x24, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xfc, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xfc, 0xff, 0x07, 0x48, 0xf9, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0f, 0x7f, 0xf8, 0xc7, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xc7, 0xf8, 0x7f, 0x8f, 0x91, 0x72, 0x0e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0f, 0x1e, 0x3d, 0x7b, 0x77, 0xf7, 0xef, 0xef, 0xef, 0xef, 0xf7, 0xf7, 0xfb, 0xbd, 0x9e, 0x6f, 0x23, 0x15, 0x0c, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

      //frame4
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0x3c, 0xde, 0xef, 0xf7, 0xf7, 0xef, 0xdf, 0x3d, 0xf1, 0xc5, 0x26, 0x2c, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfe, 0x1f, 0xe1, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xe1, 0x1f, 0xfe, 0xe1, 0x09, 0x49, 0x5e, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x0f, 0xff, 0xfc, 0x00, 0x92, 0x93, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0x24, 0x24, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xf0, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0x3f, 0x40, 0x49, 0xc9, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x7f, 0xf8, 0x87, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x87, 0xf8, 0x7f, 0x87, 0x90, 0x92, 0x7a, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0f, 0x3c, 0x7b, 0xf7, 0xef, 0xef, 0xf7, 0xfb, 0xbc, 0x8f, 0xa3, 0x64, 0x34, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

      //frame5
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3c, 0xc3, 0xc3, 0x3d, 0xc1, 0x05, 0x25, 0x27, 0x3c, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0xc0, 0xff, 0xff, 0xc0, 0x3f, 0xc0, 0x09, 0x49, 0x49, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x00, 0x92, 0x92, 0x92, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x00, 0x24, 0x24, 0x24, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x00, 0x49, 0x49, 0x49, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfc, 0x03, 0xff, 0xff, 0x03, 0xfc, 0x03, 0x90, 0x92, 0x92, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x3c, 0xe3, 0xe3, 0xbc, 0x83, 0xa4, 0xa4, 0xe4, 0x3c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

      //frame6
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, 0x49, 0x49, 0x49, 0x49, 0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x92, 0x92, 0x92, 0x92, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0x24, 0x24, 0x24, 0x24, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb6, 0x49, 0x49, 0x49, 0x49, 0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x92, 0x92, 0x92, 0x92, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0x24, 0x24, 0x24, 0x24, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xc9, 0xc9, 0xc9, 0xc9, 0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

      //frame7
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3c, 0x27, 0x25, 0x05, 0xc1, 0x3d, 0xc3, 0xc3, 0x3c, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x49, 0x49, 0x09, 0xc0, 0x3f, 0xc0, 0xff, 0xff, 0xc0, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x92, 0x92, 0x92, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x24, 0x24, 0x24, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x49, 0x49, 0x49, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0x92, 0x92, 0x90, 0x03, 0xfc, 0x03, 0xff, 0xff, 0x03, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x3c, 0xe4, 0xa4, 0xa4, 0x83, 0xbc, 0xe3, 0xe3, 0x3c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

      //frame8
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x2c, 0x26, 0xc5, 0xf1, 0x3d, 0xdf, 0xef, 0xf7, 0xf7, 0xef, 0xde, 0x3c, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x5e, 0x49, 0x09, 0xe1, 0xfe, 0x1f, 0xe1, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xe1, 0x1f, 0xfe, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x93, 0x92, 0x00, 0xfc, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x0f, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x24, 0x24, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xc9, 0x49, 0x40, 0x3f, 0xff, 0xf0, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x7a, 0x92, 0x90, 0x87, 0x7f, 0xf8, 0x87, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x87, 0xf8, 0x7f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x34, 0x64, 0xa3, 0x8f, 0xbc, 0xfb, 0xf7, 0xef, 0xef, 0xf7, 0x7b, 0x3c, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

      //frame9
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x30, 0xa8, 0xc4, 0xf6, 0x79, 0xbd, 0xdf, 0xef, 0xef, 0xf7, 0xf7, 0xf7, 0xf7, 0xef, 0xee, 0xde, 0xbc, 0x78, 0xf0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x70, 0x4e, 0x89, 0xf1, 0xfe, 0x1f, 0xe3, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xe3, 0x1f, 0xfe, 0xf0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x9f, 0x12, 0xe0, 0xff, 0x3f, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x3f, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x24, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf9, 0x48, 0x07, 0xff, 0xfc, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xfc, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0e, 0x72, 0x91, 0x8f, 0x7f, 0xf8, 0xc7, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xc7, 0xf8, 0x7f, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x0c, 0x15, 0x23, 0x6f, 0x9e, 0xbd, 0xfb, 0xf7, 0xf7, 0xef, 0xef, 0xef, 0xef, 0xf7, 0x77, 0x7b, 0x3d, 0x1e, 0x0f, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

      //frame10
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0xa0, 0xd0, 0xe8, 0xf4, 0x7a, 0xbd, 0xdd, 0xdf, 0xef, 0xef, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xef, 0xee, 0xde, 0xdc, 0xbc, 0x78, 0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0xcc, 0xf3, 0xfc, 0x7f, 0x8f, 0xf7, 0xf9, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xf9, 0xf7, 0x8f, 0x7f, 0xfc, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3e, 0xc1, 0xfe, 0xff, 0x7f, 0x81, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x81, 0x7f, 0xff, 0xfe, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x7c, 0x83, 0x7f, 0xff, 0xfe, 0x81, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x81, 0xfe, 0xff, 0x7f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x33, 0xcf, 0x3f, 0xfe, 0xf1, 0xef, 0x9f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x9f, 0xef, 0xf1, 0xfe, 0x3f, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x05, 0x0b, 0x17, 0x2f, 0x5e, 0xbd, 0xbb, 0xfb, 0xf7, 0xf7, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xf7, 0x77, 0x7b, 0x3b, 0x3d, 0x1e, 0x0f, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

      //frame11
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0xa0, 0xd0, 0xe8, 0xf4, 0x7a, 0xba, 0xbd, 0xdd, 0xdf, 0xef, 0xef, 0xef, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xef, 0xee, 0xee, 0xde, 0xdc, 0xbc, 0xb8, 0x78, 0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0xec, 0xf2, 0xfd, 0x3e, 0xdf, 0xe7, 0xfb, 0xfd, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfd, 0xfb, 0xe7, 0xdf, 0x3e, 0xfc, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3c, 0xc3, 0xfc, 0xff, 0x7f, 0x87, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x87, 0x7f, 0xff, 0xfc, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x3c, 0xc3, 0x3f, 0xff, 0xfe, 0xe1, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xe1, 0xfe, 0xff, 0x3f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x37, 0x4f, 0xbf, 0x7c, 0xfb, 0xe7, 0xdf, 0xbf, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xbf, 0xdf, 0xe7, 0xfb, 0x7c, 0x3f, 0x0f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x05, 0x0b, 0x17, 0x2f, 0x5e, 0x5d, 0xbd, 0xbb, 0xfb, 0xf7, 0xf7, 0xf7, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xf7, 0x77, 0x77, 0x7b, 0x3b, 0x3d, 0x1d, 0x1e, 0x0f, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

    };

    void coinFlipAnimation()
    {
      uint8_t aniFrame = 0;
      uint8_t aniTime = 0;

      while (aniTime <= 51)
      {
        //aniTime increases in value
        aniTime++;

        //when aniTime's value is at 50
        //aniFrame's value will increase by 1
        if (aniTime == 50)
        {
          aniFrame++;
          aniTime = 0;
        }

        //when aniFrame's value is 11
        //aniFrame's and aniTime's value is reset
        if (aniFrame == 11)
        {
          aniFrame = 0;
          aniTime = 51;
        }

        //displaying aniFrame changes
        Sprites::drawOverwrite(4, 4, coinFrames, aniFrame);
        arduboy.display();
      }

    }

    void setup()
    {
      // put your setup code here, to run once:
      arduboy.boot();
    }

    void loop()
    {
      // put your main code here, to run repeatedly:
      if (!arduboy.nextFrame())
        return;

      arduboy.clear();

      Sprites::drawOverwrite(4, 4, coinFrames, 0);

      arduboy.pollButtons();

      //when a is pressed coinFlipAnimation plays 3 times
      //it is the best thing i can come up with
      if (arduboy.justPressed(A_BUTTON))
      {
        coinFlipAnimation();
        coinFlipAnimation();
        coinFlipAnimation();
      }

      arduboy.display();
    }
1 Like

Firstly, don’t use boot unless you’re desparate for extra memory,
and if you do use it, make sure to also call arduboy.flashlight() and arduboy.systemButtons(), and arduboy.audio.begin() (if you’re using audio).

These days it’s rare for people to get upload problems, but if they do having flashlight() and systemButtons() can make life a lot easier and hence they should always be called by every program.


First off, obviously a 12 frame 56x56 animation is going to eat into progmem quite a bit, so if you were planning to use this for a game you’d have to think about the impact of that.

On to your actual code, you should ideally only call arduboy.display() once, in loop.

Calling it in a while loop like you’re doing means the framerate regulation doesn’t work properly so you aren’t actually running the animation at 60fps, you’re running it as fast as the screen can handle.
If you did this in a game, you’d also be stopping everything else from happening, including player input and other animations.

(For the sake of my examples, I’m going to assume that coinFrames is defined in a header file called CoinFrames.h, otherwise my comment is actually too long to post purely because of the amount of frame data.)

So let’s start by transitioning your code to a proper update loop…

#include <Arduboy2.h>

Arduboy2 arduboy;

#include "CoinFrames.h"

// Constants defining the first and last frames of the animation
constexpr uint8_t animationFirstFrame = 0;
constexpr uint8_t animationLastFrame = 11;

// A variable for tracking the current frame of the animation
uint8_t animationFrame = 0;

// Whether the animation should be updated or not
bool animationEnabled = false;

// A function for updating the animation
void updateAnimation()
{
  // If the current frame index is less than the last frame
  if(animationFrame < animationLastFrame)
  {
    // Increase the frame index
    ++animationFrame;
  }
  // Otherwise
  else
  {
    // Reset the animation
    animationFrame = animationFirstFrame;
    
    // Stop updating the animation
    animationEnabled = false;
  }
}

// A function for drawing the coin
void drawCoin()
{
    Sprites::drawOverwrite(4, 4, coinFrames, animationFrame);
}

void setup()
{
  arduboy.begin();
}

void loop()
{
  if (!arduboy.nextFrame())
    return;

  arduboy.clear();

  arduboy.pollButtons();

  // If A is pressed
  if (arduboy.justPressed(A_BUTTON))
  {
    // Enable the animation
    animationEnabled = true;
  }
  
  // If the animation is enabled
  if(animationEnabled)
  {
    // Update the animation
    updateAnimation();
  }

  // Always draw the coin, whether it's animated or not  
  drawCoin();

  arduboy.display();
}

This works, though the animation is running at 60fps, and since you only have 12 frames, that means the whole animation is over in barely 1/3rd of a second.

To slow it down an easy option is to use arduboy.everyXFrames(), which will only return true every few frames (depending on how many frames you specify.
For example, if you used arduboy.everyXFrames(5), you could slow the animation down to 12 frames per second (60 / 5 = 12), and since you have 12 frames, that would mean the whole animation would complete in 1 second.

Like so:

#include <Arduboy2.h>

Arduboy2 arduboy;

#include "CoinFrames.h"

// Constants defining the first and last frames of the animation
constexpr uint8_t animationFirstFrame = 0;
constexpr uint8_t animationLastFrame = 11;

// A variable for tracking the current frame of the animation
uint8_t animationFrame = 0;

// Whether the animation should be updated or not
bool animationEnabled = false;

// A function for updating the animation
void updateAnimation()
{
  // If the current frame index is less than the last frame
  if(animationFrame < animationLastFrame)
  {
    // Increase the frame index
    ++animationFrame;
  }
  // Otherwise
  else
  {
    // Reset the animation
    animationFrame = animationFirstFrame;
    
    // Stop updating the animation
    animationEnabled = false;
  }
}

// A function for drawing the coin
void drawCoin()
{
    Sprites::drawOverwrite(4, 4, coinFrames, animationFrame);
}

void setup()
{
  arduboy.begin();
}

void loop()
{
  if (!arduboy.nextFrame())
    return;

  arduboy.clear();

  arduboy.pollButtons();

  // If A is pressed
  if (arduboy.justPressed(A_BUTTON))
  {
    // Enable the animation
    animationEnabled = true;
  }
  
  // If the animation is enabled
  if(animationEnabled)
  {
    // Every 5th frame
    if(arduboy.everyXFrames(5))
    {
      // Update the animation
      updateAnimation();
    }
  }

  // Always draw the coin, whether it's animated or not  
  drawCoin();

  arduboy.display();
}

In case it’s hard to spot, essentially Iv’e just changed this:

// If the animation is enabled
if(animationEnabled)
{
  // Update the animation
  updateAnimation();
}

To this:

// If the animation is enabled
if(animationEnabled)
{
  // Every 5th frame
  if(arduboy.everyXFrames(5))
  {
    // Update the animation
    updateAnimation();
  }
}

I’ll let you adjust things to your liking.
With a bit of maths you can figure out what framerates you can achieve.
You can’t achieve every framerate possible, but having the main animation loop running at 60fps offers quite a lot of flexibility.

@VivaPerosa ,

When you post code in this forum, please enclose it in markdown code tags:

Start with a line containing three backticks followed by cpp
Insert your code starting on the following line.
On the line following you code, put another three backticks.
The backtick character is commonly on the key below the Esc key at the top left of the keyboard. If you can’t find it on your keyboard, you can copy and paste from the tags here:

```cpp
The first line of your code
More code
The last line of your code
```

I’ve added the tags to your post above but please do it yourself in the future.

Honestly I used boot() because I felt that the boot animation took too long, I didn’t know that there would be uploading issues if I used boot(), if you’re wondering yes I had A LOT of uploading issues and I was wondering why. Now that I know I’ll just use begin() for now on.

I haven’t even touched audio yet so that’ll be it’s own can of worms.

Ha, I know, I’m trying to make a coin flip game, as I was making the coin sprite I asked myself, “Why not just animate it?” and here we are. When I got it to work I really liked how it turned out, since I had a feeling that I would make more animations because I’m a mad man.

I haven’t been doing a good job placing drawOverwrite(), it never crossed my mind to make animationFrame a global variable, let alone thought of variables to define the first frame and last frame.

When I first programed this I made it spin infinitely and boy did it, it was kind of funny seeing the coin spin so fast making screen tears, I could think about then was, “Boy, look at that coin GOOOOOO!”

In this case I didn’t mind all too much since I wanted to coin to do it’s animation before the player makes a decision (yes/no and head/tail) but of course for different projects I would want the player to do something while an animation is being played.

The only differences I made was made uint8_t animationLoop = 0; then I added animationLoop++; when animationFrame is reset to the first frame, finally I added an if statement stating that if animationLoop is at 3 animationEnabled is set to false. When I run into other problems I’ll let you guys know.

You have two choices if you don’t want to wait for the boot logo:

  1. Press the Right D-pad button before or during the time that the logo is scrolling down. You’ll go straight to the game when the button is released.

  2. Load the SetSystemEEPROM example sketch from the Arduboy2 library. In the Arduino IDE:
    File > Examples > Arduboy2 > SetSystemEEPROM

    • Press Left for the flags menu
    • Set show boot logo to NO
    • Press B to save the settings

    Even if the sketch has used begin(), the boot logo will no longer appear when you power up. You will go straight to the game.

1 Like

Huh, didn’t know that, really what don’t I know. Speaking of things I don’t know, I don’t know why this switch statement wont work. The idea is to basically manually change gamestate by pressing a button - any button really.

  uint8_t gamestate = 0;

  arduboy.clear();

  //to change screens
  switch (gamestate)
  {
    case 0:
      //title screen
      displayTitle();
      if (arduboy.justPressed(A_BUTTON))
        gamestate = 1;
      break;
    case 1:
      //gameplay screen
      displayCoinFrames();
      displayQuestionsPrompt();
      drawScoreboard();
      displayUIBorder();
      if (arduboy.justPressed(A_BUTTON))
        gamestate = 2;
      break;
    case 2:
      //special thank you screen
      font3x5.setCursor(0, 0);
      font3x5.print("WORK IN PROGRESS");
      if (arduboy.justPressed(A_BUTTON))
        gamestate = 0;
      break;
  }

You need to put the following line at the top of you main game’s loop.

arduboy.pollButtons();

This function captures the previous button state and compares them to the current button state of this frame. This is then used in functions such as justPressed()

https://mlxxxp.github.io/documents/Arduino/libraries/Arduboy2/Doxygen/html/classArduboy2Base.html#a2f275c7d4a3438f7be543a02eb9a7d00

Using arduboy.pollButtons(); made no difference.

Is that the extent of your code? Can you paste up the lot?

It’s almost impossible to tell what’s wrong from just that snippet.

The most obvious answer I can think of is that you’re probably using a local gamestate variable instead of a global one, hence any value you write to it is irrelevant because it’s destroyed at the end of the function and recreated with a value of 0 when the function is reentered.


In fact, if that is the case, after compiler optimisations are taken into account the compiler might well elminate everything from the switch apart from displayTitle() because it ought to be able to work out that the other two cases can’t be reached, the gamestate = 1 is useless and hence the expression in the if condition is also useless (depending on whether or not it can prove justPressed has no side effects).

Never used GitHub before but here it is.

Change the code to …

void setup()
{
  arduboy.begin();
  Arduboy2::generateRandomSeed();
  arduboy.setFrameRate(60);
  // arduboy.pollButtons();  Commented out.
}

void loop()
{
  //prevents arduboy from running too fast
  if (!arduboy.nextFrame())
    return;

  arduboy.pollButtons(); // Moved to here ..

  uint8_t gamestate = 0;

  arduboy.clear();

  //to change screens
  switch (gamestate)

Both @filmote and I were correct.

You need arduboy.pollButtons() in loop() for the button states to be updated properly, and gamestate needs to be made global for your state changes to actually take effect.

Also you should be calling arduboy.initRandomSeed() instead of Arduboy2::generateRandomSeed().
generateRandomSeed() generates a seed value for a PRNG (which you are effectively discarding),
whereas initRandomSeed() seeds the PRNG used by random with a value generated by generateRandomSeed()

With those things in mind, and incorporating the changes @filmote made, the code should look like:

//Marcus L. Sanders II
//Coin Toss Main
//8.6.2020

#include <Arduboy2.h>
#include "PerosaFont3x5.h"
#include "Coin.h"
#include "Display.h"

Arduboy2 arduboy;
PerosaFont3x5 font3x5;

void setup()
{
  arduboy.begin();
  arduboy.initRandomSeed();
}

// gamestate must be global so it persists between calls to loop
uint8_t gamestate = 0;

void loop()
{
  //prevents arduboy from running too fast
  if (!arduboy.nextFrame())
    return;

  // The buttons must be updated once per loop
  arduboy.pollButtons();

  arduboy.clear();

  //to change screens
  switch (gamestate)
  {
    case 0:
      //title screen
      displayTitle();
      if (arduboy.justPressed(A_BUTTON))
        gamestate = 1;
      break;
    case 1:
      //gameplay screen
      displayCoinFrames();
      displayQuestionsPrompt();
      drawScoreboard();
      displayUIBorder();
      if (arduboy.justPressed(A_BUTTON))
        gamestate = 2;
      break;
    case 2:
      //special thank you screen
      font3x5.setCursor(0, 0);
      font3x5.print("WORK IN PROGRESS");
      if (arduboy.justPressed(A_BUTTON))
        gamestate = 0;
      break;
  }

  arduboy.display();
}

Also, @VivaPerosa, If you want more entropy for your generated seed, you should call initRandomSeed() after waiting a somewhat random delay after the sketch starts (as is suggested in the documentation for initRandomSeed()).

You can do this by waiting until after the first time the user presses the A button before calling initRandomSeed(). Using @Pharap’s code example above:

Arduboy2 arduboy;
PerosaFont3x5 font3x5;
// Flag to indicate that the random number generator has been seeded
bool rngSeeded = false;

void setup()
{
  arduboy.begin();
//  arduboy.initRandomSeed(); // Don't call it here
}
  //to change screens
  switch (gamestate)
  {
    case 0:
      //title screen
      displayTitle();
      if (arduboy.justPressed(A_BUTTON))
      {
        // If the random number generator hasn't been seeded
        if (!rngSeeded)
        {
          arduboy.initRandomSeed();
          rngSeeded = true; // Indicate that the RNG was seeded
        }
        gamestate = 1;
      }
      break;

I feel the need to point out that unless it’s specifically required that the PRNG is only set once, or doing so has some provable benefit, tracking a set-once flag may be more effort (and more importantly may require more progmem) than it’s worth.

I’ve always wondered whether reseeding a PRNG is a detriment compared to letting the generator run it’s course uninterrupted. I’ve never bothered to research this. I guess it would depend on the particular PRNG algorithm and how random each successive seed is.

That said, for a coin toss or similar function, it may be better to not even use a PRNG, instead relying on the inability of a human to precisely time an event for randomness. While waiting for the user to press a button, increment a counter as constantly and rapidly as possible. When the button is pressed, use the least significant bit of the counter to indicate heads or tails. For a coin toss, just using millis() to read the system time would probably work fine.

Ah, I see. You see I wayback when I first created the switch statement gamestate was a global variable I just didn’t used pollButtons() because I assumed justPressed() already checks the current state of the button and tracks it. After I saw it not working I kept changinggamestate to a global or local variable, when @filmote mentioned pollButtons() I kept moving to setup() and loop() just to see what would work. As you can tell none of it worked.

But that leads me to a question, why would pollButtons() work in loop() but not in setup()?

Read and save the current state of the buttons and also keep track of the button state when this function was previouly called.

Is it that pollButtons() will only work in the function that calls for it, or if its being inherited from a parent function?

So this wouldn’t work

void setup()
{
  arduboy.begin();
  pollButtons();
}

void loop()
{
  if (arduboy.justPressed(A_BUTTON))
}

But this would

void setup()
{
  arduboy.begin();
  pollButtons();
  if (arduboy.justPressed(A_BUTTON))
}

As for using generateRandomSeed() over initRandomSeed(). When I was reading the library I interpreted initRandomSeed() as random while generateRandomSeed() is LOL, SO RANDOM XD seeing you guys talk about it I feel like I’m more or less right with that interpretation. When I asked myself “Which one do I use?” I just shrugged and said whatever. I will need random numbers for my next project so it’s better to know this now.

Please read the documentation for pollButtons() in the Arduboy2 library documentation.

Also look at the justPressed() documentation which states:

Return true if the given button was pressed between the latest call to pollButtons() and previous call to pollButtons() .

pollButtons() needs to be called before each set of justPressed() and/or justReleased() tests in order to keep track of the previous button state compared to the current button state. (Note that the name includes the the word poll.)

1 Like

That doesn’t answer my question.

That’s where I got this quote

Read and save the current state of the buttons and also keep track of the button state when this function was previouly called.

Even in justPressed() you quoted

Return true if the given button was pressed between the latest call to pollButtons() and previous call to pollButtons()

When I read it I assumed that once pollButtons() is used it keeps track of a buttons’s state, so it wouldn’t matter if pollButtons() is used in setup() or loop() it will keep track of a buttons’ state. That’s why I asked

But that leads me to a question, why would pollButtons() work in loop() but not in setup() ?

And gave my example so my question can be better understood.

You must not have read the sentence in the next paragraph, which states:

This function should be called once at the start of each new frame.

And you must not have looked at the example, which shows pollButtons() being called after the nextFrame() test at the start of loop()

How could there be a latest call and a previous call if you only call it once?