'value' does not name a type - error

Hi, thanks for this tuto,
i use the library EEPROM.h for my Sketch and get this error for the compiler : ‘value’ does not name a type.
Please, can have your help. Thanks again.

lamboni75:
Hi, thanks for this tuto,
i use the library EEPROM.h for my Sketch and get this error for the compiler : 'value' does not name a type.
Please, can have your help. Thanks again.

Hi, the word 'value' does not appear in the EEPROM library.

Are you creating a variable of a class/struct named 'value' or using a function parameter of a class/struct named 'value'?

Post your sketch

pYro_65:
Hi, the word ‘value’ does not appear in the EEPROM library.

Are you creating a variable of a class/struct named ‘value’ or using a function parameter of a class/struct named ‘value’?

Post your sketch

Thanks,
the sketch is :

#include <EEPROM.h>
#include <LiquidCrystal.h>
//*****************************
LiquidCrystal Ecran(12, 11, 5, 4, 3, 2);

int Address = 0;
byte value;
int Heures=23;
int Minutes=03;
int Secondes=59;
int Jours=29;
const int Relais = 8;

void setup() {
Serial.begin(9600);
pinMode(Relais, OUTPUT);
Ecran.begin(16,2);}
value = EEPROM.read(Address);
Minutes = value;
void loop() {

while ( Minutes == 0) {
digitalWrite(Relais, LOW);
Ecran.setCursor(0,0);
Ecran.print(" TEMPS “);
Ecran.setCursor(0,1);
Ecran.print(” COMPTE EXPIRE “);
}
digitalWrite(Relais, HIGH);
delay(1000);
Ecran.setCursor(0,0);
Ecran.print(” TEMPS ");
Secondes --;
if (Secondes < 00) {Minutes --; Secondes = 59;};
if (Minutes < 00) {Heures --; Minutes = 59;};
if (Heures < 00) {Jours --; Heures = 23;};
if (Jours < 00) {Jours = 0;};
Ecran.setCursor(0,1);
if (Jours < 10) {Ecran.print(“0”);};
Ecran.print(Jours); Ecran.print(“J”);
Ecran.setCursor(4,1);
if (Heures < 10) {Ecran.print(“0”);};
Ecran.print(Heures); Ecran.print(“H”);
Ecran.setCursor(8,1);
if (Minutes < 10) {Ecran.print(“0”);};
Ecran.print(Minutes); Ecran.print(“Mn”);
Ecran.setCursor(13,1);
if (Secondes < 10) {Ecran.print(“0”);};
Ecran.print(Secondes); Ecran.print(“S”);
EEPROM.write(Address,Minutes);
}

Hi, please use Ctrl+T or select the auto-text-format tool in the menu.
The compiler tells in which line number the problem is. You can turn on the line numbers in the settings. The first error of the compiler is the most important. The compiler says that it has problems with "value = EEPROM.read(Address) ;". That is code outside the setup() function and outside the loop() function.

An if-statement does not need a semicolon after the closing bracket.

I think the "while ( Minutes == 0) {" will run forever and never get out of that loop.

Please don't use a space in front of the decrement operator.

  Secondes --;    // not good
  Secondes--;    // good

Hi,
i use the library EEPROM.h for my Sketch and get this error for the compiler : ‘value’ does not name a type.
Please, can have your help. Thanks again.

This is the code:

#include <EEPROM.h>
#include <LiquidCrystal.h>
//*****************************
LiquidCrystal Ecran(12, 11, 5, 4, 3, 2);

int Address = 0;
byte value;
int Heures=23;
int Minutes=03;
int Secondes=59;
int Jours=29;
const int Relais = 8;

void setup() {
Serial.begin(9600);
pinMode(Relais, OUTPUT);
Ecran.begin(16,2);}
value = EEPROM.read(Address);
Minutes = value;
void loop() {

while ( Minutes == 0) {
digitalWrite(Relais, LOW);
Ecran.setCursor(0,0);
Ecran.print(" TEMPS “);
Ecran.setCursor(0,1);
Ecran.print(” COMPTE EXPIRE “);
}
digitalWrite(Relais, HIGH);
delay(1000);
Ecran.setCursor(0,0);
Ecran.print(” TEMPS ");
Secondes --;
if (Secondes < 00) {Minutes --; Secondes = 59;};
if (Minutes < 00) {Heures --; Minutes = 59;};
if (Heures < 00) {Jours --; Heures = 23;};
if (Jours < 00) {Jours = 0;};
Ecran.setCursor(0,1);
if (Jours < 10) {Ecran.print(“0”);};
Ecran.print(Jours); Ecran.print(“J”);
Ecran.setCursor(4,1);
if (Heures < 10) {Ecran.print(“0”);};
Ecran.print(Heures); Ecran.print(“H”);
Ecran.setCursor(8,1);
if (Minutes < 10) {Ecran.print(“0”);};
Ecran.print(Minutes); Ecran.print(“Mn”);
Ecran.setCursor(13,1);
if (Secondes < 10) {Ecran.print(“0”);};
Ecran.print(Secondes); Ecran.print(“S”);
EEPROM.write(Address,Minutes);
}

That’s the same code you posted a couple of days ago. The problem has already been explained to you by Koepel. The error is caused by your code, not by the EEPROM library. Before posting code please Auto Format and use code tags.

moderator: Split off this topic as it has nothing to do with the EEPROM library

tip use CTRL-T to auto indent your code

AND

check the amount of { }