티스토리 뷰

SWDesk/Firmware

EEPROM Test

bizmaker 2020. 3. 29. 23:07

 

#include <EEPROM.h>
int addr = 0;

String InputString = "Test/String!";
int TestCount =0;


void setup() {
  // put your setup code here, to run once:
  EEPROM.begin(512);

}

void loop() {
  // put your main code here, to run repeatedly:
  delay(1000);
  String String1 = InputString + TestCount;

}

void b_WriteChar_EEPROM(int Address, char Char){
  EEPROM.write(Address, Char);
  EEPROM.commit();
}

void b_WriteString_EEPROM(int Address, int Length, char* Chars){
  for(int Index1=0; Index1<Length; Index1++){
    EEPROM.write(Address+Index1, Chars[Index1]);
  }
  EEPROM.commit();
}

char b_ReadChar_EEPROM(int Address){
  return (char)EEPROM.read(Address);
}

String b_ReadChars_EEPROM(int Address, int Length){
  String ReadString1 = "";
  for(int Index1=0; Index1<Length; Index1++){
    ReadString1 = ReadString1 + b_ReadChar_EEPROM(Address + Index1);
  }

  return ReadString;  
}

 

반응형
반응형
250x250
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
글 보관함