Pages: [1]   Go Down
Author Topic: Quick help with EEPROM.read()  (Read 428 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 42
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
//____________Defining global variables________________________________________
    boolean pType = 0; //Choose BAR = false /psi = true =!0

//____________Reading values from eeprom_______________________________________
 pType = EEPROM.read(0);

void saveSettings()
    {
      if (flagChanges = 1) //Only save if necassary!
          {
            EEPROM.write(0,pType); //Pressure units
          }
       else
          {
             lcd.clear();
             lcd.setCursor(2, 1); // set the cursor to column 3, line 0                         
             lcd.print("NO CHANGES MADE!");
             lcd.setCursor(4, 2); // set the cursor to column 3, line 0                         
             lcd.print("EXITING MENU");
             delay(500);
             menu.moveUp(); //EXIT up one level   
          }   
    }

Causes error message
Quote
expected constructor, destructor, or type conversion before '=' token

I can't figure out what's causing this.
« Last Edit: February 28, 2011, 08:58:22 am by Bebbetufs » Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12480
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you post your whole code we can reproduce the feature.

I assume  pType = EEPROM.read(0);  is causing the error as it is done outside a function ...
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

0
Offline Offline
Newbie
*
Karma: 0
Posts: 42
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry.
Had to attach it as zip.
It is too big for the forum.... but, you are right. I need to put it inside "void setup()"

* Menu_0_0_2_8_lcd.zip (7.18 KB - downloaded 4 times.)
« Last Edit: February 28, 2011, 09:33:51 am by Bebbetufs » Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 64
Posts: 6055
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
if (flagChanges = 1) //Only save if necassary!
is not the same as
Code:
if (flagChanges == 1) //Only save if necassary!
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Pages: [1]   Go Up
Jump to: