I am trying to display a 54x54 bitmap (its a qrcode) on my LCD Display.
I am following the directions from this page
http://arduino.cc/playground/Code/LCD12864
Here is my code which is relatively simple
#include <LCD12864.h>
void setup() {
LCDA.Initialise(); // INIT SCREEN
delay(500); // Some delay
LCDA.Render(); // Start the Rendering process
LCDA.DrawSprite(5,0); // 5 is the xPOS, 0 is the yPOS
delay(500); // you may or may not need the delay
LCDA.RenderScreenBuffer(1);
}
void loop() {
}
Here is the LCDsprite.h
static int swidth = 54; // change these
static int sheight = 54; // change these
static const prog_char header_data[] PROGMEM = { // add data here
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,
1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,
1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,1,1,
1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,
1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,1,1,
1,1,0,0,1,1,1,1,1,1,1,1,1,1,0,0,
1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
1,1,0,0,1,1,0,0,1,1,1,1,1,1,1,1,
1,1,0,0,1,1,
1,1,0,0,1,1,1,1,1,1,1,1,1,1,0,0,
1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
1,1,0,0,1,1,0,0,1,1,1,1,1,1,1,1,
1,1,0,0,1,1,
1,1,0,0,1,1,0,0,0,0,0,0,1,1,0,0,
1,1,1,1,0,0,0,0,0,0,1,1,1,1,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,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1
};
It looks like the command
LCDA.RenderScreenBuffer(1);
Draws to the top part of the LCD display and
LCDA.RenderScreenBuffer(2);
Draws to the bottom
But I dont know how to specify two different images (one for the top and one for the bottom)
This is an arduino uno, arduino 1.0 and an LCD 128x64 display
So my questions are:
- How do I specify 1 sprite for the top line and 1 for the bottom?
- Is there any updated code or different lib that would work with an ST7920?
- How can I save on memory? prog_char seems to be a waste
End goal is to display multiple images (not concurrently) and it being fed through the USB cable.
Thanks,
Larry Apolonio

