#include "at24cxx.h"
AT24C32 at24c32;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(27, OUTPUT);
digitalWrite(27, HIGH); //Write protect test
Wire1.begin(33,32,100000);
at24c32.begin(0x57, Wire1);
uint32_t data = 0xAE962B61;
at24c32.write(4000, data); // Write protect area
Serial.println(at24c32.read(4000)); // 255
char *str = "abcdefghijklmnopqrstuvwxyz0123456789";
char strR[strlen(str)+1];
at24c32.write(0,(byte*)str,strlen(str)+1);
at24c32.read(0,(byte*)strR,strlen(str)+1);
Serial.println(strR);
Serial.println(at24c32.read()); // 255
Serial.println(strcmp(str,strR));
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}