Hello again,
At the beginning of my sketch, I tried to follow what the GLCD 16x16px image input looks like, so here's the code of the bitmap I made:
- Code: Select all
// a bitmap of nyancat
const unsigned char nyancat_bmp [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x02, 0xF1, 0x09, 0x15, 0x05, 0x05, 0x05, 0x45, 0x05,
0x05, 0x05, 0x15, 0xC5, 0x25, 0x25, 0x45, 0xA5, 0x09, 0xF1, 0x02, 0xFC, 0x80, 0x40, 0x20, 0x20,
0xC0, 0x00, 0x06, 0x09, 0x11, 0x16, 0x24, 0x24, 0xFF, 0x00, 0x3F, 0x60, 0x81, 0x80, 0x90, 0x82,
0x80, 0xC0, 0x80, 0x88, 0xFC, 0x83, 0x00, 0x00, 0x10, 0xD8, 0x81, 0x81, 0xC1, 0x91, 0x80, 0xD0,
0x18, 0x00, 0x83, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x09, 0x09, 0x0D, 0x06, 0x02, 0x0E, 0x0A,
0x0A, 0x06, 0x02, 0x02, 0x02,
};
#define NYANCAT_HEIGHT 20
#define NYANCAT_WIDTH 34
Then in the loop sketch, I adjusted the test patterns that float on the screen so the code reflects my bitmap:
- Code: Select all
// draw each icon
for (uint8_t f=0; f< NUMFLAKES; f++) {
nokia.drawbitmap(icons[f][XPOS], icons[f][YPOS], nyancat_bmp, w, h, BLACK);
}
nokia.display();
delay(200);
- Code: Select all
// then erase it + move it
for (uint8_t f=0; f< NUMFLAKES; f++) {
nokia.drawbitmap(icons[f][XPOS], icons[f][YPOS], nyancat_bmp, w, h, 0);
What I hoped to see was a 34 by 20 px of everyone's favorite pastry feline, nyancat.
Instead, the adafruit logo that floats on by is replaced by random letters.
All I really want is to display my bitmap. It doesn't have to have a specific location on the screen or scroll, I just figure there's an equivalent to "nokia.drawstring" that instead would be "nokia.drawbitmap" after which I'd write (nyancat_bmp); as I declared in the beginning of the sketch.
But again I'm not really sure of what I'm doing and don't know the appropriate function/command. Thanks, hope this helps you help me!