error: 'POSITIVE' was not declared in this scope

I just updated to the latest version of Arduino.
When i run old sketches that worked perfectly in the old version, I get
error: 'POSITIVE' was not declared in this scope
In the previous version, all my sketches compile just fine, but not anymore.
I use 2x16 characters with I2C interface

Your old sketches are referring to an I2C library that is not being found by your new Arduino installation. Perhaps it was not installed in the recommended location.

Don

They are in the right pace, but maybe they are too new. If I set-up the LCD from the old:

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

to the new:

LiquidCrystal_I2C lcd(0x27,20,4);

Then I get no errors, but the LCD does not work at all.

You really should look through some of the many previous posts dealing with I2C LCD adapters.

It all boils down to the fact that either your specialized library must match your specific device or your general purpose library must use a constructor whose parameters match your specific device.

If you specify precisely which device you have and which library you are using we may be able to help. Don't just tell us you are using 'the I2C_LCD library' since there are several of them, all with the same name.

Don

More specifically, you must have the fmalpartida library installed according to the instructions as it evidently was before the change, and the original, ineffective library that the IDE provides, removed from the IDE directory tree.

The lack of that library and its installation via the IDE system is an unfortunate political problem.

I have tried different old versions of the library, but no result. I have no idea what version I used before. These are the libraries in one of my sketches, and the set-up of the LCD. This should result in an "ok" on the display.

#include <DS1302RTC.h>
#include <LiquidCrystal_I2C.h>
#include <Time.h>
#include <Wire.h>
#include <TimeAlarms.h>
#include <EEPROM.h>

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set LCD I2C

void setup()
{
        lcd.print(" Ok!");
...

I have tried different old versions of the library, but no result.

Which library are you talking about?

Please reread reply #3 before responding.

Don

I give up!
I have read lots of posts, changed to other versions of libraries, finally deleted everything and installed it again. Everytime I change something I get new errors. When the LiquidCrystal_I2C error was solved, a new error on Wire was shown. Then I got more than 30 errors.
I will not spend any more time on this. Luckily it still works using codebender.
To be able to change the engine control in my boat I now have to use some kind of wireless network, or to throw it out completely.

You are giving up without providing us with the information needed to help you.

Once again, from reply #3 (with some emphasis added):

If you specify precisely which device you have and which library you are using we may be able to help.

Don't just tell us you are using 'the I2C_LCD library' since there are several of them, all with the same name.

Don

OK, I will try to explain what I have done.
What I needed was a way to measure temperatures and speed so I got an Arduino Uno, some sensors and an LCD dispaly. As I needed to mount the dispaly and sensors remotely from the Arduino I used I2C versions. As the display is built-in into the dashboard I cannot see any details of it without dismantling the entire dashboard.
Then I searched for code and made my scetch using cut-and paste. I do not remember from where. There were no problems and I got the function I needed.
The other day I was stupid to update and the problems started. I can still run my sketched using codebender but not here.
I have tried to erase the entire installation and installed it over again with no luck.
I just tested some of the examples that were installed and I get errors there also.
So, still :frowning:

You have two basic problems that have to be addressed.

(1) You have to be able to compile your sketch with no errors. This involves having a single I2C_LCD library installed in the correct location and a sketch that uses syntax compatible with that specific library.

My suggestion would be to start with a new installation of the Arduino IDE installed in a new location rather than over an old installation.

Then you should install the library recommended by Paul in reply #4 making sure that you carefully follow the installation instructions that accompany that library.

You should now be able to compile some of the examples that also accompany that library. You won't be able to use them yet, that comes after you do step 2.

(2) Next you have to determine the address of your I2C adapter and the other parameters to use in the constructor. The values you have shown in reply #5 may or may not be correct for your device. That is where the 'I2C guesser' sketch comes into play.

Put the values you obtained in step 2 into one of the sketches from step 1 and you should be able to display one of the example sketches on your LCD.

After all this is working you can start to deal with your temperature and speed measurements.

Don

OK, I have re-installed it one more time.
Then I included one library at a time and a short code snippet and verified after each.
Then I set the LCD address according to the instructions in the new library.
Finally I copied in the rest of the code.

The result for one of the sketches (for the engine control) was OK :slight_smile:
I can not test it until I have launched the boat in about a month.

The other was compiled, but with a number of comments.
I can not test this sketch either until I get back from my vacation.
These are the comments shown:

In file included from /Users/Anne/Documents/Arduino/my_alarm_clock_3_new/my_alarm_clock_3_new.ino:1:0:
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/EEPROM/src/EEPROM.h:43:30: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
     operator const uint8_t() const       { return **this; }
                              ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/EEPROM/src/EEPROM.h:92:26: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
     operator const int() const          { return index; }
                          ^
/Users/Anne/Documents/Arduino/my_alarm_clock_3_new/my_alarm_clock_3_new.ino: In function 'void selectDay()':
/Users/Anne/Documents/Arduino/my_alarm_clock_3_new/my_alarm_clock_3_new.ino:332:9: warning: statement has no effect [-Wunused-value]
   setdag;
         ^
/Users/Anne/Documents/Arduino/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.cpp:66:6: warning: unused parameter 'cols' [-Wunused-parameter]
 void LiquidCrystal_I2C::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {

      ^
/Users/Anne/Documents/Arduino/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.cpp:307:6: warning: unused parameter 'cmdDelay' [-Wunused-parameter]
 void LiquidCrystal_I2C::setDelay (int cmdDelay,int charDelay) {}

      ^
/Users/Anne/Documents/Arduino/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.cpp:307:6: warning: unused parameter 'charDelay' [-Wunused-parameter]
/Users/Anne/Documents/Arduino/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.cpp:310:9: warning: unused parameter 'graphtype' [-Wunused-parameter]
 uint8_t LiquidCrystal_I2C::init_bargraph(uint8_t graphtype){return 0;}

         ^
/Users/Anne/Documents/Arduino/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.cpp:311:6: warning: unused parameter 'row' [-Wunused-parameter]
 void LiquidCrystal_I2C::draw_horizontal_graph(uint8_t row, uint8_t column, uint8_t len,  uint8_t pixel_col_end){}

      ^
/Users/Anne/Documents/Arduino/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.cpp:311:6: warning: unused parameter 'column' [-Wunused-parameter]
/Users/Anne/Documents/Arduino/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.cpp:311:6: warning: unused parameter 'len' [-Wunused-parameter]
/Users/Anne/Documents/Arduino/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.cpp:311:6: warning: unused parameter 'pixel_col_end' [-Wunused-parameter]
/Users/Anne/Documents/Arduino/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.cpp:312:6: warning: unused parameter 'row' [-Wunused-parameter]
 void LiquidCrystal_I2C::draw_vertical_graph(uint8_t row, uint8_t column, uint8_t len,  uint8_t pixel_row_end){}

      ^
/Users/Anne/Documents/Arduino/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.cpp:312:6: warning: unused parameter 'column' [-Wunused-parameter]
/Users/Anne/Documents/Arduino/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.cpp:312:6: warning: unused parameter 'len' [-Wunused-parameter]
/Users/Anne/Documents/Arduino/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.cpp:312:6: warning: unused parameter 'pixel_row_end' [-Wunused-parameter]
/Users/Anne/Documents/Arduino/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.cpp:313:6: warning: unused parameter 'new_val' [-Wunused-parameter]
 void LiquidCrystal_I2C::setContrast(uint8_t new_val){}

      ^
/Users/Anne/Documents/Arduino/libraries/DS1302RTC/DS1302RTC.cpp: In static member function 'static uint8_t DS1302RTC::read(tmElements_t&)':
/Users/Anne/Documents/Arduino/libraries/DS1302RTC/DS1302RTC.cpp:89:19: warning: comparison is always true due to limited range of data type [-Wtype-limits]
   if(tm.Second >= 0 && tm.Second <= 59)
                   ^
/Users/Anne/Documents/Arduino/libraries/DS1302RTC/DS1302RTC.cpp:90:21: warning: comparison is always true due to limited range of data type [-Wtype-limits]
     if(tm.Minute >= 0 && tm.Minute <= 59)
                     ^
/Users/Anne/Documents/Arduino/libraries/DS1302RTC/DS1302RTC.cpp:91:21: warning: comparison is always true due to limited range of data type [-Wtype-limits]
       if(tm.Hour >= 0 && tm.Hour <= 23)
                     ^
/Users/Anne/Documents/Arduino/libraries/DS1302RTC/DS1302RTC.cpp:95:29: warning: comparison is always true due to limited range of data type [-Wtype-limits]
               if(tm.Year >= 0 && tm.Year <= 99)
                             ^

So, since you are now working with your alarm clock code, can we assume that the I2C_LCD examples compiled correctly?

Don

Hi Don
Unfortunately, I can not test the code irl just now, but I think they compiled almost correctly. I just dont understand the info that was output, see post #11.
Björn