Question using EEPROM

For the discussion of Arduino related topics.

Moderator: phalanx

Post Reply
brian25
Posts: 15
Joined: Sat Jun 22, 2013 5:22 am

Question using EEPROM

Post by brian25 » Tue Aug 13, 2013 10:34 pm

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

Code: Select all

char p1[] = {"11111"};

void Password(){
  
  char p2[5];
  int y = sizeof(p1);
  int flag=0;
  
  for (int x=0;x<=y;x++)
  {
    p2[x]= p1[x];
  }
 
  
  if(gsm.readSMS(smsbuffer, 5, p2, 5) == 0)
  flag=1;
  {
    if(strstr(smsbuffer,"11111") != NULL){
    Serial.println(strcmp(smsbuffer,"Matched"));
    }
    else if(strstr(smsbuffer," ") != NULL){
    flag=2;
    
    
  }
    }
  if(flag==2){    
    Serial.println(strcmp(smsbuffer,"Matched"));
    delF();
    }
    else if(flag==1){    
    Serial.println(strcmp(smsbuffer,"Don't Matched"));
    delF();
   
}
}
  
void delF()
{
 Serial.println("Executing delete");
     for (int j=0;j<=4;++j){     
     Serial.println(sms.DeleteSMS(j));
     }
}

Mee_n_Mac
Support Volunteer
Posts: 5628
Joined: Thu Apr 28, 2011 4:10 pm

Re: Question using EEPROM

Post by Mee_n_Mac » Tue Aug 13, 2013 11:31 pm


Post Reply