Displaying EEPROM data on 16x2 LCD

I have put data on Arduino Uno EEPROM from address 0 to 255. I can display EEPROM data on one individual location but I am unable to read one location, display the same and then read the next location and display it. My code is displaying only the first location. Do I need to refresh the LCD to put new data?

EEPROM_read.ino (458 Bytes)

Here is how you should have posted your code. Please post code in the forum and use code tags when you do

#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
#include <EEPROM.h>
int i = 0;
int j;
void setup()
{
  // put your setup code here, to run once:
  lcd.begin(16, 2);
  lcd.print("HuLu");
  //lcd.setCursor(0,1);
  //EEPROM.write(i,j);
  //lcd.print(EEPROM.read(0));
}

void loop()
{
  // put your main code here, to run repeatedly:
  j = EEPROM.read(i);
  i++;
  lcd.setCursor(0, 1);
  lcd.print(j);
  if (i = 255)
  {
    i = 0;
  }
  delay(1000);
}
if (i = 255)

What do you think this line does ?
What does it actually do ?

Your code is very similar to this one except for the LCD display. You can find there some help.

  if (i = 255)

oops.... :wink:

Definitely will not do what is likely expected as single equal is for assignment not evaluation.

--- bill

UKHeliBob:
Here is how you should have posted your code. Please post code in the forum and use code tags when you do

Just my opinion, but I don't think it should matter how a user posts his code.
Why should a poster have to tip toe around other forum users not having their environment set up correctly to handle attachments?
IMO, if it is that big of deal to make things simpler for those that don't have their environment and/or browsers configured properly to deal with attachments, then the forum s/w should be fixed to also inline the attachment whenever it is of certain types like many other forums do rather than try to coerce its users to post things a certain way.

There are several things that this forum s/w doesn't do that many of the other forums I use handle automatically.

--- bill

Just my opinion, but I don't think it should matter how a user posts his code.

As you know, opinions vary on this

As it happens I do think that I was too harsh in my reply to the post and it would have been better to have explained why posting the code in a different way would have been more helpful,

It does, however, irk me that users do not take the time to read advice in the plainly visible stickies in this forum often resulting in no code or a small isolated portion of code being posted and, of course, we have all seen code with smileys in it or partially in italics, bold, underlined etc

As to possible changes to the forum software, I am sure that you know where to post such comments/suggestions