Question using EEPROM

Thread Starter

brian25

Joined May 13, 2013
37
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


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:

Thread Starter

brian25

Joined May 13, 2013
37
i'm using arduino.

can you help me with codings? i'm working now with arduino library password.h
the concept is when the pass is correct it will jump to the main program and it also have change or reset pass

just don't mind the eeprom. tnx
 
Last edited:
Top