This is a demonstration program which draws a keypad on the LCD and uses the touch screen to allow an operator to key-in an access code. Two possible codes are allowed to grant to different levels of access. Additionally the push button is used to allow an operator to send Moorse Code pulses in to the device which is checked against two characters to determine if there was a match, and if so, access is granted.

Dependencies:   LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI mbed-os BSP_DISCO_F429ZI

Also draws a mushroom on the screen and animates it.

Revision:
5:5c507689ae66
Parent:
3:0e554d8d5a19
diff -r 5c70a30d6757 -r 5c507689ae66 SecurityUnlockDemo-Keypad.cpp
--- a/SecurityUnlockDemo-Keypad.cpp	Tue Jun 04 22:51:25 2019 +0000
+++ b/SecurityUnlockDemo-Keypad.cpp	Wed Jun 05 02:27:51 2019 +0000
@@ -13,6 +13,7 @@
 #include "TS_DISCO_F429ZI.h"            // For controlling the touch screen
 #include "SecurityUnlockDemo-Main.h"    // Bring in the main module
 #include "SecurityUnlockDemo-Keypad.h"  // Always include our own header
+#include "PizzaBMPHeader.h"             // For the Pizza BMP file
 
 // ----------------------------------------------------------------------
 // Describe data which is defined externally that we may access
@@ -33,7 +34,7 @@
     // In this demonstration we define two access levels, access level 1
     // grants full access to all functionality whereas access level 2 is
     // for accessing less functionality
-    static const uint8_t * ACCESS_LEVEL_1 = "31415926";
+    static const uint8_t * ACCESS_LEVEL_1 = "3141";
     static const uint8_t * ACCESS_LEVEL_2 = "2040";
 
     // When we build the keypad screen, we use the data in this table
@@ -324,6 +325,9 @@
     // For the keypad's general text we want characters to be this color
     st_lcd.SetTextColor(LCD_COLOR_BLUE);
     
+    // Display pizza
+    st_lcd.DrawBitmap(1, 60, st_PizzaBMP);
+    
     // Build the ketypad display
     st_lcd.DisplayStringAt(1, LINE(0), (uint8_t *)"Enter access code or", CENTER_MODE);
     st_lcd.DisplayStringAt(1, LINE(1), (uint8_t *)"use the Moorse Code", CENTER_MODE);