0
#include<Wire.h>
#include<Eeprom24C32_64.h>
#define EEPROM_ADDRESS 0x000
void setup() {
 Serial.begin(9600);
 eeprom.initialize();
 const word address = 0x000;
 const byte count = 94;
 byte inputBytes[count] = { 0 };
 byte outputBytes[count] = { 0 };
 Serial.println("Read bytes from EEPROM memory...");
 eeprom.readBytes(address, count, outputBytes);
 Serial.println("Read bytes:");
 for (byte i = 0; i < count; i++) {
 Serial.write(outputBytes[i]);
 Serial.print(" ");
 }
 Serial.println("");
}
void loop() {
}

Next code... I have tried many sketches.

#include <EEPROM.h>
void setup () {
 Serial.begin (115200);
 Serial.println ();
 for (int addr = 0x0000; addr < 0x0010; addr++) {
 Serial.print ("Address = ");
 Serial.print (addr, HEX);
 Serial.print (", value = ");
 Serial.println (EEPROM.read(addr), HEX);
 }
} // end of setup
void loop () {
}

And most of the sketches check the internal EEPROM of the Arduino, not the external, stored on address 0x000. I want to read data from external AT24C32.

enter image description here

dda
1,5951 gold badge12 silver badges17 bronze badges
asked Dec 20, 2017 at 12:12
4
  • 2
    And what have you tried...? Commented Dec 20, 2017 at 12:13
  • 1
    @IHaveQuestion Please don't post code in the comments. Edit your question and add the code there. Commented Dec 20, 2017 at 12:16
  • @Majenko done code added plz help to solve this Commented Dec 20, 2017 at 12:23
  • @sempaiscuba done all codes Commented Dec 20, 2017 at 12:24

1 Answer 1

1

You have to know what the I2C address of your EEPROM is. Right now you have

#define EEPROM_ADDRESS 0x000

The example from the library you cite has this:

/**************************************************************************//**
 * \def EEPROM_ADDRESS
 * \brief Address of EEPROM memory on TWI bus.
 ******************************************************************************/
#define EEPROM_ADDRESS 0x50

Then, you have to create an instance of the Eeprom24C32_64 object:

static Eeprom24C32_64 eeprom(EEPROM_ADDRESS);

That sets up the object for the EEPROM on the right I2C address, so you can later use the eeprom object to read and write.

answered Dec 20, 2017 at 15:20
1
  • Your picture shows an LCD display. Are you expecting output to that? Commented Dec 21, 2017 at 3:44

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.