This procedure is applicable to :1: Meeting C language , Yes STM32, understand STM32 Students with external circuits who can draw inferences from one instance
    2: Meeting C perhaps C++ language , I've played with the interface , Just press the key to change it into an interface button , Deposit eeprom It can be changed into a read-write file
                    3: If only C language , Get to know the idea ,

                    4: If you only know the hardware , no problem , Software science is not as difficult as you think

void set_password(void) { char i,j = 0; char password_buf[6] = {0};
// Temporary storage , To store the password in eeprom int m=0; // Used as password success judgment int k = -1;// password , Range 0~9 char store[50]
= {0}; // in order to lcd Display stored data _REINPUT: delay(MSec(80));
// Delay Functions , It needs to be packaged by itself , If with operating system , According to the nature of the system , If there is no system , Two for Circulation is OK
LCD_Show(" Please press the key to set the password :");//LCD Display function , It needs to be packaged by itself j = 0; m = 0; while(1) { k = -1;
if(scan_key_down("PE1")) // Determine the function of pressing key , Self based STM32 Of IO Property and actual hardware circuit writing { delay(MSec(50));
if(scan_key_down("PE1")) { for(i=0;i<300;i++) { delay(MSec(100));
if(((i%5)==0)&&(i!=0)) //5 In order to enter if, It also acts as a time delay { k++; if(k>9) { k = 0; // Limit password range to 9 within
} sprintf(store," Password No %d position : %d",j+1,k); // coordination LCD output LCD_Show(store); }
if(read_IO("PE1")==1) // Detect release key function , Release the key to jump out of the cycle ,k Is a bit of the password { break; } } m++;
password_buf[j] = k; // Password storage j++; if(j>5) // Limit password number { j=0; k=-1; } } }
if(scan_key_down("PE2"))// Press the key to select the mode , Use the other button { delay(MSec(50));
if(scan_key_down("PE2")) { if(m%6==0&&m!=0) { LCD_Show(" Password settings OK!");
for(i=0;i<6;i++) { printf(" Password No %d position :%d\n",i+1,passwordBuf[i]);
eeprom_wr8((char)password_buf[i],900+i); // Password write in eeprom delay(MSec(10)); }
delay(Sec(2)); } else { LCD_Show(" Password settings NG!"); LCD_Show(" Please re-enter the password !");
delay(Sec(2)); goto _REINPUT; // Call back to start execution again } break; } } delay(MSec(20)); } }
Welcome to communicate with our friends , If there is a mistake , Hope to inform , Correct together , Common progress .

Technology
©2019-2020 Toolsou All rights reserved,
use easyPOI Import Excel data Vue Transfer parameters and receiving of page Jump Digital rolling lottery program The difference between memory overflow and memory leak , Causes and Solutions vue monitor Treeselect Change of options Image format conversion TypeScript- Polymorphism JavaScript Medium Call and Applyk8s Entry to give up --k8s Key concepts How to build data security system ?