puo' essere
comunque, visto che l'esempio va (altrimenti chissa' quanti ne avrebbero scritto su github) è la nostra implementazione che non va
l'unica vera differenza tra la versione che usiamo
(giusta regola non devo appropriarmi dei vostri meriti, usate voi, io sono appena arrivato)
e la versione dell'esempio è nell'indirizzo io ipotizzo un errore nell'inizializzazione dell'indirizzo
propongo di provare
#include <Wire.h>
#include <AT24CX.h>
// EEPROM object
AT24CX mem(7,32);
// setup
void setup() {
// serial init
Serial.begin(115200);
Serial.println("AT24CX read/write demo");
Serial.println("----------------------");
Serial.println("Write 42 to address 12");
mem.write(12, 42);
Serial.println("Read byte from address 12 ...");
byte b = mem.read(12);
Serial.print("... read: ");
Serial.println(b, DEC);
Serial.println();
// read and write integer
Serial.println("Write 65000 to address 15");
mem.writeInt(15, 65000);
Serial.println("Read integer from address 15 ...");
unsigned int i = mem.readInt(15);
Serial.print("... read: ");
Serial.println(i, DEC);
Serial.println();
// read and write long
Serial.println("Write 3293732729 to address 20");
mem.writeLong(20, 3293732729UL);
Serial.println("Read long from address 20 ...");
unsigned long l = mem.readLong(20);
Serial.print("... read: ");
Serial.println(l, DEC);
Serial.println();
// read and write long
Serial.println("Write 1111111111 to address 31");
mem.writeLong(31, 1111111111);
Serial.println("Read long from address 31 ...");
unsigned long l2 = mem.readLong(31);
Serial.print("... read: ");
Serial.println(l2, DEC);
Serial.println();
// read and write float
Serial.println("Write 3.14 to address 40");
mem.writeFloat(40, 3.14);
Serial.println("Read float from address 40 ...");
float f = mem.readFloat(40);
Serial.print("... read: ");
Serial.println(f, DEC);
Serial.println();
// read and write double
Serial.println("Write 3.14159265359 to address 50");
mem.writeDouble(50, 3.14159265359);
Serial.println("Read double from address 50 ...");
double d = mem.readDouble(50);
Serial.print("... read: ");
Serial.println(d, DEC);
Serial.println();
// read and write char
Serial.print("Write chars: '");
char msg[] = "This is a message";
Serial.print(msg);
Serial.println("' to address 200");
mem.writeChars(200, msg, sizeof(msg));
Serial.println("Read chars from address 200 ...");
char msg2[30];
mem.readChars(200, msg2, sizeof(msg2));
Serial.print("... read: '");
Serial.print(msg2);
Serial.println("'");
Serial.println();
}
io non ho l'hardware, quindi non so se va
ma guardando la libreria sembra che se l'operazione NON va a buon fine ritorna comunque senza segnalazione d'errore