Hello all,
I am trying to write and read to a 24LC256 eeprom with my Arudino Uno.
I don't know if I'm not properly writing to the 24LC256, or if I am not properly reading the information.
I found this write up on youtube: - YouTube
It seems to be working, except it is returning -1 for the value read from the chip.
I have tried researching it and couldn't find what the -1 is meaning.
Below is the code, along with a screen shot of the Serial output.
Any help would be greatly appreciated.
Thank you
n8er``
#include <Wire.h>
int data = 0;
byte high = 0x00, low=0x00;
void setup(void){
Wire.begin();
Serial.begin(9600);
Serial.println("Serial Connection Made.");
}
void loop(){
Wire.beginTransmission(0x50);
Wire.write(high);
Wire.write(low);
Wire.write('H');
Wire.endTransmission();
delay(5);
Wire.beginTransmission(0x50);
Wire.write(high);
Wire.write(low);
Wire.endTransmission();
Wire.requestFrom(0x50,1);
delay(5);
Serial.print(Wire.read());
Serial.print(" Address ");
Serial.print(high);
Serial.print(" ");
Serial.println(low);
data++;
if(data > 255) data=0;
if(low == 255) high++;
low++;
}