Need help with LCD ...
 
Notifications
Clear all

Need help with LCD - I2C project

9 Posts
6 Users
1 Reactions
7,036 Views
tek6420
(@tek6420)
Member
Joined: 5 years ago
Posts: 5
Topic starter  

Working with the LCD-I2C demo.

The sketch will not 'compile'. I did read/recover the the I2C address as 0x27. I changed the I2C address in the sketch but the error message remains the same.

I am lost as to what the 'machine' is trying to tell me. I am about ready to start deleting all 'Library' files and start over. 

<<<<<<<<<<<<<<<<from IDE>>>>>>>>>>>>>>>>>>>>>>>>>

/*
LCD Display with I2C Interface Demo
lcd-i2c-demo.ino
Use NewLiquidCrystal Library
DroneBot Workshop 2018
https://dronebotworkshop.com
*/

// Include Wire Library for I2C
#include <Wire.h>
// Include NewLiquidCrystal Library for I2C
#include <LiquidCrystal_I2C.h>

// Define LCD pinout
const int en = 2, rw = 1, rs = 0, d4 = 4, d5 = 5, d6 = 6, d7 = 7, bl = 3;

// Define I2C Address - change if reqiuired
const int i2c_addr = 0x3F;

LiquidCrystal_I2C lcd(i2c_addr, en, rw, rs, d4, d5, d6, d7, bl, POSITIVE);

void setup()

Arduino: 1.8.10 (Windows 10), Board: "Arduino/Genuino Uno"

lcd-i2c-demo:20:65: error: 'POSITIVE' was not declared in this scope

LiquidCrystal_I2C lcd(i2c_addr, en, rw, rs, d4, d5, d6, d7, bl, POSITIVE);

^~~~~~~~

Multiple libraries were found for "Wire.h"
Used: C:\Program
Multiple libraries were found for "LiquidCrystal_I2C.h"
Used: C:\Working
Not used: C:\Working
exit status 1
'POSITIVE' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


   
Quote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@Bob,

Are you using the exact same display as per Bill's article?
In his article he also provides alternative configuration details for the LCD object.

Sometimes one error can cause a flow on of misleading errors too.

I'm unable to test it right now, but you may well have an new and older version of the library which doesn't declare the POSITIVE variable.  Check for which libraries you have installed, and maybe even try to update them via the IDE.


   
ReplyQuote
(@zeferby)
Member
Joined: 5 years ago
Posts: 355
 

@bob

Maybe you are not using the exact same library as Bill ? There are MANY LCD libs around...

It should be this one, which I also use with platform.io (updated version) : https://github.com/olewolf/DHT_nonblocking

Original location : https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home

The POSITIVE symbol is defined in its LCD.h header file :

image

Eric


   
ReplyQuote
 bob
(@bob)
Member
Joined: 5 years ago
Posts: 2
 

@zeferby @frogandtoad

Great to see you offering support. You had both replied to @bob, which is actually my "nicename". The poster's "nicename" is under their name inside brackets and is currently in smaller grey type. 

I'm sure @tek6420 probably received notification of your replies anyway, but just in case I have mentioned him here.

Just a suggestion Bill, but going with slightly larger type and switching the grey to something a little more eye catching might help to make the "nicename" a bit more obvious. Keep up the great work!!

. wpf-author-nicename {
color: #034190;
font-size: 13px;
}

   
ReplyQuote
(@zeferby)
Member
Joined: 5 years ago
Posts: 355
 

LOL, sorry @bob, and ping @tek6420

 

Eric


   
ReplyQuote
tek6420
(@tek6420)
Member
Joined: 5 years ago
Posts: 5
Topic starter  

I took my problem into the 'fart sack' last evening to give same some additional thought. This morning I focused on the IDE 'advisory' "Multiple libraries were found for "Wire.h"
Used: C:\Program
Multiple libraries were found for "LiquidCrystal_I2C.h"
Used: C:\Working" and deleted all 'Library' files in  the C:\Program directory.

I am now happy to state that the 'lcd-ic2-demo' project is working fine. The only change I had to make original 'ino' file was to change the I2C address to 0x27, the address of my specific I2C device.

I still do not understand the meaning of the IDE advisory "exit status 1
'POSITIVE' was not declared in this scope". I expect that I will understand these statements as I gain experience.

What I learned from this experience; Do not install library files unless same are needed.


   
ReplyQuote
(@zeferby)
Member
Joined: 5 years ago
Posts: 355
 
Posted by: @tek6420

What I learned from this experience; Do not install library files unless same are needed.

This is one of the reasons why I more and more like platform.io : the ability to add libs for one project only

Eric


   
ReplyQuote
Duce robot
(@duce-robot)
Member
Joined: 5 years ago
Posts: 689
 

Yes I have been here those libraries are a stickler the right library will solve it. ?  in fact I'm still rebuilding my lib vault because I had to wipe my old one because of this .


   
ReplyQuote
(@walkergw)
Member
Joined: 5 years ago
Posts: 1
 

@tek6420

I am having the SAME Identical problem.  Oddly, these sketches worked fine 2 years ago.  For a multitude of reasons, I had to let these projects languish.  But, I come back now and I get these "POSITIVE" errors.  What exactly did you do to solve this?? 

Thanks!!

GW


   
ReplyQuote