// vANESSA HARDEN (lcd CODE) #include #include #include "settings.h" // #include "timerx8.h" #include "images.h" #include "font5x7.h" #include "EpsonCommands.h" #include "lcdinterface.h" #include "displayFns.h" #include "displayStrings.h" int main(void) { int i; DDRA &= ~_BV(PA5); LCDInit(); //wait a bit... for (i=0;i<35;i++) { _delay_ms(30); } LCDInit(); //wait one second... for (i=0;i<10;i++) { _delay_ms(100); } LCD_display_image(MICRO_IMG); //wait one second... for (i=0;i<10;i++) { _delay_ms(100); } // draw a multi-colored square in the center of screen //for (i = 0; i < 4096; i++){ //i < 4096 // LCD_put_pixel((i % 64) + 32, (i / 64) + 32,i); //} SendLCDCommand(DISON); BACKLIGHT_ENABLE_PORT |= _BV(BACKLIGHT_ENABLE_PIN); //pull enable pin high, enable backlight sei(); //enable interrupts while (1) { uint8_t pixelColor = 0; uint64_t i;//x,y int byteIndex; GotoXY(0,0); //set to origin byteIndex = 0 * HEIGHT * WIDTH; //find the first byte of the image SendLCDCommand(RAMWR); //write to RAM (will overwrite all 128x28 pixels) for (i = 0; i < (HEIGHT*WIDTH); i++) { pixelColor = pgm_read_byte(&(images[byteIndex][i])); if (!(PINA & _BV(PA5))) { // If the switch is closed pixelColor = ~pixelColor; } SendLCDData(pixelColor); } SendLCDCommand(NOP); //wait one second... for (i=0;i<10;i++) { _delay_ms(100); } } }