Re: LCD 240x128 need help
OK maybe this can help you (not tested):
#define PIXELS_IN_X 240
#define PIXELS_IN_Y 128
const unsigned char Mask[8]={0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; // for setting/clearing a dot
unsigned char Shadow_Memory[PIXELS_IN_Y][PIXELS_IN_X / 8]; // this holds what is displayed at the LCD
// allowed range for x:0 (left) to 239 (right), allowed range for y:0 (top) to 127 (bottom)
void set_pixel(unsigned char x, unsigned char y)
{
unsigned char mask=Mask[x & 0x07];
Shadow_Memory[y][x >> 3]|=mask;
}
// allowed range for x:0 (left) to 239 (right), allowed range for y:0 (top) to 127 (bottom)
void clear_pixel(unsigned char x, unsigned char y)
{
unsigned char mask=Mask[(x & 0x07) ^ 0xFF];
Shadow_Memory[y][x >> 3]&=mask;
}
And you still need a function that outputs Shadow_Memory byte by byte to your LCD at 70 or more times per second and this is the main problem that can not easily be solved with a small mirocontroller as I have written earlier ....
best regards