QWERTY Keypad Touchscreen LCD Demo - MBED + SmartGPU2 board

Dependencies:   SMARTGPU2 mbed

Revision:
2:2c1cb73e48d8
Parent:
1:5278445c0b86
--- a/main.cpp	Thu Apr 17 21:49:24 2014 +0000
+++ b/main.cpp	Fri Apr 18 01:04:14 2014 +0000
@@ -20,7 +20,7 @@
 #define LETTERSUPPER     1
 #define NUMBERS          2
 #define SPECCHAR         3
-#define KEYBOARD_X_SIZE  320
+#define KEYBOARD_X_SIZE  LCD_WIDTH
 #define KEYBOARD_Y_SIZE  KEYBOARD_X_SIZE/2
 #define KEY_Y_TOP        MAX_Y_LANDSCAPE - KEYBOARD_Y_SIZE //at the bottom of screen
 #define KEYXSIZE         KEYBOARD_X_SIZE/10 //10 - columns
@@ -172,7 +172,7 @@
      //once obtained a valid key
      if(key!=OK && key!=DEL && key!=TYPE && key!=KEYCASE){              //only print if key is not special key
        lcd.putLetter(lastX, currentY, key, &currentX);                  //print key on lastX and save updated value in currentX
-       if(lastX==currentX){                                             //if currentX couldn't advance, means end of X row
+       if(currentX<=lastX){                                             //if currentX couldn't advance, means end of X row
          currentY += 20;                                                //jump 1 row in Y axis
          if(currentY >= (KEY_Y_TOP-5)){                                 //if we reach the start of the keyboard
            currentY=5;
@@ -207,7 +207,7 @@
      } 
      //draw the animated key
      drawSingleKey(key, currentKeyboard, SELECTED);                     //draw the obtained key button as SELECTED
-     wait_ms(200);                                                      //wait 200ms with key as SELECTED
+     delay(200);                                                        //wait 200ms with key as SELECTED
      drawSingleKey(key, currentKeyboard, DESELECTED);                   //draw the obtained key button as DESELECTED     
    }
 }
\ No newline at end of file