I2C and 'POSITIVE' was not declared in this scope

Hello all. I’m a newbie to Aruino. I have an I2C 2 line display and am trying to compile a sketch to make the display show a simple message. I’ve been sifting through the dozen or so forums here and elsewhere trying to find the answer to why I keep getting the message “‘POSITIVE’ was not declared in this scope”.

I’ve seen where people suggest downloading the “correct fm” library, delete the old library, etc. which I have tried multiple times, but I am having no success.

Oddly enough, I was able to upload a working sketch to the same hardware about 9 months ago. I do not remember exactly how I accomplished this, although I do remember stumbling upon the working code somehow. I am now using a different computer (W7 Pro laptop) and have copied the working sketch from my old computer to this one. I installed the latest version of Arduino 1.6.11 and opened the sketch but it simply will not compile. I keep getting the error message : “‘POSITIVE’ was not declared in this scope”.

I’ve got an Arduino UNO board and an LCM1602 IIC V1 display. I can also confirm from the previously working sketch that the address is Ox27.

Help me please! And thank you in advance!

Working_LCD_0.0.ino (856 Bytes)

(deleted)

First, please learn how to post your code between the code tags

so that the code is in a box like this

so that people don’t have to download it. You will find that more people will look at your problem.

#include <Wire.h>
#include <LiquidCrystal_I2C.h>


#define   CONTRAST_PIN   9
#define   BACKLIGHT_PIN  7

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


// Creat a set of new characters

;

void setup()
{
  Serial.begin ( 57600 );

  // Switch on the backlight and LCD contrast levels
  pinMode(CONTRAST_PIN, OUTPUT);
  analogWrite ( CONTRAST_PIN, CONTRAST );

  //lcd.setBacklightPin ( BACKLIGHT_PIN, POSITIVE );
  //lcd.setBacklight ( HIGH );
  lcd.backlight();
    
  lcd.begin(16,2);               // initialize the lcd 


  lcd.home ();                   // go home
  lcd.print(" RESISTANCE IS");  
  lcd.setCursor ( 0, 1 );        // go to the next line
  lcd.print ("     FUTILE     ");   
  delay(20000);
  lcd.home ();
  lcd.print("SUCCESSFUL ");
  lcd.setCursor ( 0, 1 ); 
  lcd.print("HORRAY");
  
     
}

void loop()
{
  
}

I’ve seen where people suggest downloading the “correct fm” library, delete the old library, etc. which I have tried multiple times, but I am having no success.

What does “I am having no success” mean? Finding the library on the internet, downloading it, installing it, removing the library that comes with the ide?

What is the complete error message you see. Does it complain about more than the word “POSITIVE”?

#define   CONTRAST_PIN   9
#define   BACKLIGHT_PIN  7

For a start, the constructor says the backlight is on 3. Don’t try to PWM the contrast just set it up with the potentiometer on the i2c module. The library should start with the backlight on by default.

Everything is pointing towards that fact that you don’t have the F Malpartida library correctly installed.

cattledog: First, please learn how to post your code between the code tags

My apologies about not posting the code correctly. I will attempt to do this correctly next time, given the benefits you have described.

cattledog: What does "I am having no success" mean? Finding the library on the internet, downloading it, installing it, removing the library that comes with the ide?

I have found the library and downloaded it. I've tried a few different sources. I have deleted the old libraries and installed the new ones (I think) and every time I try a different one, nothing changes, which leads me to your next statement:

cattledog: Everything is pointing towards that fact that you don't have the F Malpartida library correctly installed.

Which I believe is the problem I'm having. Maybe you could give me some step-by-step directions on how to do this? Judging from the other posts on the internet regarding this particular display and code, it would seem us noobs can't seem to do this properly!

What I have been doing is navigating to the Arduino folder in C:\program files (x86)\Arduino\libraries, find the old libraries there and delete them. I also go to my Documents folder where the sketch is stored and delete it there as well. (I have not found an option within the Arduino environment where deleting a library is possible, however I could be overlooking it and if it is possible, I surely would like to know.) I then launch the Arduino IDE and choose to include the new library by selecting the .zip file option. I then go to the sketch code and delete the #include line in the code and then choose the new library to be included.

Am I doing this correctly, or am I overlooking something?

I have had trouble with the direct install of the zip library from the bitbucket site linked in reply #1.

Try this procedure which installs the extracted library.

Download the most recent version of the library from the bitbucket site. v 1.3.4

When it is downloaded, extract all files. The extracted folder, should contain 2 folders, one called _MACOSX and the other called NewLiquidCrystal. Take the folder called NewLiquidCrystal and moved it to your user libraries folder.

See if that process gets the library installed properly.