BMP Images Photo Frame Demo - MBED + SmartGPU2 board

Dependencies:   SMARTGPU2 mbed

Files at this revision

API Documentation at this revision

Comitter:
emmanuelchio
Date:
Fri Apr 18 00:44:42 2014 +0000
Parent:
1:5fbcbf55bb8f
Commit message:
SmartGPU2 Photoframe_SG2 demo- Please select(uncomment) your smartGPU2 board under SMARTGPU2.h file before compiling!!!

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 5fbcbf55bb8f -r 0aca9184311d main.cpp
--- a/main.cpp	Thu Apr 17 23:51:42 2014 +0000
+++ b/main.cpp	Fri Apr 18 00:44:42 2014 +0000
@@ -37,15 +37,15 @@
   lcd.SDFopenDir("BMP Images");              //Open the BMP Images that contains the images
   
   while(1){   //Loop forever in the slide show!
-    lcd.imageBMPSD(0,0,imagesOnSDCard[pic]); //Load image from SD card, all images are 320x240(full screen) so we load them from top left corner X:0,Y:0
-    lcd.imageBMPSD(3,219,"previous");        //Load the previous icon        
-    lcd.imageBMPSD(300,219,"next");          //Load the next icon
+    lcd.imageBMPSD(0,0,imagesOnSDCard[pic]); //Load image from SD card, all images are full screen so we load them from top left corner X:0,Y:0
+    lcd.imageBMPSD(3,LCD_HEIGHT-20,"previous");        //Load the previous icon          
+    lcd.imageBMPSD(LCD_WIDTH-20,LCD_HEIGHT-20,"next"); //Load the next icon
        
     wait_ms(100);                            //A little delay to avoid fast image changing
     while(lcd.touchScreen(&point)==INVALID); //Wait for a touch on the screen to show next or previous picture
     
     //check if we go to the next image, or to the previous one
-    if(point.x>160){                         //if the received touch was on the right middle of the screen we advance the image, else we decrease and go to previous image
+    if(point.x>(LCD_WIDTH/2)){               //if the received touch was on the right middle of the screen we advance the image, else we decrease and go to previous image
       pic++;                                 //decrease image selector
       if(pic>7){                             //if we reach the position of the last image, we restart to image 0
         pic=0;