 void readHum(byte* ptr){
   float h = dht.readHumidity();
   if (!isnan(h)){
-    ptr[3] = (byte)h;
-    ptr[1] = 255;
+    EEPROM.write(3,(byte)h);    
+    
   }
   else{
-    ptr[1] = 14;      
+    EEPROM.write(32,14);
+          
   }
 }
 void readLum(byte* ptr){
-  ptr[4] = analogRead(lightsSnsorPin);
-  ptr[1] = 255;
+  EEPROM.write(4,analogRead(lightsSnsorPin));
+  
 
 }
 
 void readSwitch(byte* ptr){
   for(int i = 0; i < sizeof(switchesBytes)-1; i++){
-    ptr[switchesBytes[i]]=switchStatus[i];
-
+     EEPROM.write(switchesBytes[i],switchStatus[i]);
   }
-  ptr[1] = 255;
 }
 
 void writeSwitch(byte* ptr){

  readHum(ptr);
  readLum(ptr);
  readSwitch(ptr);
}

void writeSensors(byte* ptr){

void readTemp(byte* ptr){
  float t = dht.readTemperature();
  if (!isnan(t)){
    EEPROM.write(2,(byte)t);
  }
  else{
    EEPROM.write(32,13);
  }


