Demo of the RA8875 Keypad to enter a username and password.

Dependencies:   mbed RA8875 Keypad

Files at this revision

API Documentation at this revision

Comitter:
WiredHome
Date:
Sat Mar 05 16:50:26 2016 +0000
Parent:
2:117fb9168afc
Child:
4:8c1932fcd628
Commit message:
improve error messages in demo when touch calibration fails. Update for one keypad API that was unnecessary, and eliminated.

Changed in this revision

Keypad.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Keypad.lib	Sat Mar 05 16:23:10 2016 +0000
+++ b/Keypad.lib	Sat Mar 05 16:50:26 2016 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/users/WiredHome/code/Keypad/#6d05764dfde7
+https://developer.mbed.org/users/WiredHome/code/Keypad/#402f1126a3ec
--- a/main.cpp	Sat Mar 05 16:23:10 2016 +0000
+++ b/main.cpp	Sat Mar 05 16:50:26 2016 +0000
@@ -46,8 +46,12 @@
             fwrite(&matrix, sizeof(tpMatrix_t), 1, fh);
             fclose(fh);
         } else {
+            lcd.printf("Cannot save calibration in /local/tpcal.cfg\r\n");
+            wait_ms(1000);
         }
     } else {
+        lcd.printf("TouchPanelCalibrate returned error code %d\r\n", r);
+        wait_ms(2000);
     }
 }
 
@@ -113,7 +117,8 @@
     char name1[10];
     
     // copy definition and then resize it
-    memcpy(&tiny, kp.GetInternalKeypad(), sizeof(Keypad::keyboard_t));
+    kp.SetKeyboard();   // select the internal keyboard
+    memcpy(&tiny, kp.GetKeyboard(), sizeof(Keypad::keyboard_t));
     tiny.x = x; tiny.y = y;
     tiny.width = w; tiny.height=h;
     
@@ -165,4 +170,3 @@
         wait(5);
     }
 }
-