How to save the password in eeprom? when the device is turn off the pass was still in the chip.
and what syntax to use for changing the password?
tnx
and what syntax to use for changing the password?
tnx
Rich (BB code):
#include <Password.h>
boolean started=false;
Password password = Password( "1234" );
byte currentLength = 0;
void setup(){
Serial.begin(9600);
Serial.println("Enter Password");
}
void loop()
{
if(started){
char smsbuffer = Serial.read();
String n=smsbuffer;
if(gsm.readSMS(smsbuffer, 5, n ,5) == 0){
{
switch (smsbuffer){
case 'Reset': //reset password
password.reset();
currentLength = 0;
Serial.println("\tPassword is reset!");
break;
case '1234': //evaluate password
if (password.evaluate()){
Serial.println("\tAuthorized!");
mainp();
}else{
Serial.println("\tUnauthorized");
}
break;
default: //append any keypress that is not a '!' nor a '1234'
password.append(smsbuffer);
currentLength++;
//Print some feedback.
Serial.print("Enter password: ");
for (byte i=0; i<currentLength; i++){
Serial.print('*');
}
Serial.println();
}
}
}
}
void mainp()
{
}
}
Last edited: