Hi all,
first of all im sorry for little bit english..
(I have 7" LCD /w touch screen + Mega 2560 + TFT Shield /w SD.)
Im use this code for create password screen;
// UTFT_Buttons_Demo_320x240 (C)2013 Henning Karlsen
// web: http://www.henningkarlsen.com/electronics
//
// A small demo to demonstrate the use of some of the
// functions of the UTFT_Buttons add-on library.
//
// This demo was made for modules with a screen resolution
// of 320x240 pixels, but should work on larger screens as
// well.
//
// This program requires both the UTFT and UTouch libraries
// in addition to the UTFT_Buttons add-on library.
//
#if defined(__AVR__)
#define imagedatatype unsigned int
#elif defined(__PIC32MX__)
#define imagedatatype unsigned short
#elif defined(__arm__)
#define imagedatatype unsigned short
#endif
#include <UTFT.h>
#include <UTouch.h>
#include <UTFT_Buttons.h>
// Declare which fonts we will be using
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t Dingbats1_XL[];
extern uint8_t SevenSegNumFont[];
// Set up UTFT...
// Set the pins to the correct ones for your development board
// -----------------------------------------------------------
// Standard Arduino 2009/Uno/Leonardo shield : <display model>,19,18,17,16
// Standard Arduino Mega/Due shield : <display model>,38,39,40,41
// CTE TFT LCD/SD Shield for Arduino Due : <display model>,25,26,27,28
// Standard chipKit Uno32/uC32 : <display model>,34,35,36,37
// Standard chipKit Max32 : <display model>,82,83,84,85
// AquaLEDSource All in One Super Screw Shield : <display model>,82,83,84,85
//
// Remember to change the model parameter to suit your display module!
UTFT myGLCD(CTE70,38,39,40,41);
// Set up UTouch...
// Set the pins to the correct ones for your development board
// -----------------------------------------------------------
// Standard Arduino 2009/Uno/Leonardo shield : 15,10,14,9,8
// Standard Arduino Mega/Due shield : 6,5,4,3,2
// CTE TFT LCD/SD Shield for Arduino Due : 6,5,4,3,2
// Standard chipKit Uno32/uC32 : 20,21,22,23,24
// Standard chipKit Max32 : 62,63,64,65,66
// AquaLEDSource All in One Super Screw Shield : 62,63,64,65,66
UTouch myTouch(6,5,4,3,2);
// Finally we set up UTFT_Buttons :)
UTFT_Buttons myButtons(&myGLCD, &myTouch);
void setup()
{
myGLCD.InitLCD();
myGLCD.clrScr();
myGLCD.setFont(BigFont);
myTouch.InitTouch();
myTouch.setPrecision(PREC_MEDIUM);
myButtons.setTextFont(BigFont);
myButtons.setSymbolFont(SevenSegNumFont);
}
void loop()
{
int but1, but2, but3, but4, but5, but6, but7, but8, but9, but10, but11, but12, but13, butX, butY, pressed_button;
boolean default_colors = true;
but1 = myButtons.addButton( 10, 20, 130, 105, "1", BUTTON_SYMBOL);
but2 = myButtons.addButton( 10, 135, 130, 105, "4", BUTTON_SYMBOL);
but3 = myButtons.addButton( 10, 250, 130, 105, "7", BUTTON_SYMBOL);
but4 = myButtons.addButton( 10, 365, 130, 105, "*" );
but5 = myButtons.addButton( 150, 20, 130, 105, "2", BUTTON_SYMBOL);
but6 = myButtons.addButton( 150, 135, 130, 105, "5", BUTTON_SYMBOL);
but7 = myButtons.addButton( 150, 250, 130, 105, "8", BUTTON_SYMBOL);
but8 = myButtons.addButton( 150, 365, 130, 105, "0", BUTTON_SYMBOL);
but9 = myButtons.addButton( 290, 20, 130, 105, "3", BUTTON_SYMBOL);
but10 = myButtons.addButton( 290, 135, 130, 105, "6", BUTTON_SYMBOL);
but11 = myButtons.addButton( 290, 250, 130, 105, "9", BUTTON_SYMBOL);
but12 = myButtons.addButton( 290, 365, 130, 105, "#" );
but13 = myButtons.addButton( 450, 20, 300, 105, "" );
//butX = myButtons.addButton(279, 199, 40, 40, "2", BUTTON_SYMBOL);
//butY = myButtons.addButton(279, 299, 100, 40, "1", BUTTON_SYMBOL | BUTTON_SYMBOL_REP_3X);
myButtons.drawButtons();
//myGLCD.print("You pressed:", 160, 205);
myGLCD.setColor(VGA_BLACK);
myGLCD.setBackColor(VGA_WHITE);
//myGLCD.print("None ", 160, 220);
while(1)
{
if (myTouch.dataAvailable() == true)
{
pressed_button = myButtons.checkButtons();
if (pressed_button==but1)
myGLCD.print("*", 550, 72);
if (pressed_button==but2)
myGLCD.print("*", 160, 220);
if (pressed_button==but3)
myGLCD.print("*", 160, 220);
if (pressed_button==but4)
myGLCD.print("*", 160, 220);
//if (pressed_button==-1)
//myGLCD.print("None ", 160, 220);
}
}
}
But, use this keypad how do I coding an advanced password entry.
I want to this input features;
Max 6 digit password and user-replaceable.
1 Master Password,
Set Password + Clear Button
3 false input lock system.
Thank you very much if you could help in this regard.


