A neat section of code in the iLocker is the portion that allows the user to change the combination. The user must use pushbutton navigation to select “Change Code” in the menu. Upon selecting this option, the program prints “Enter the Combination” to the LCD screen, followed by a reading of the current combination digit, the current combination entry, and the current status of the iLocker (‘Waiting…’).
This display is the same as that if you were simply trying to unlock the iLocker. It will give the same status indicators, except if you enter the correct combination, it will bring up a new display that says “Enter New Combination”. At this time, the user can input a new combination using the same process outlined for entering a combination normally. Once the user has enter four digits successfully, the program will automatically re-write to the EEPRROM with the entered value at the address location 0x00. This will then allow the user to unlock the device with the new password, even if the device restarts or resets in the event of a power failure. A portion of the code responsible for storing the new combination in EEPROM is shown below.