Using LCD Displays ...
 
Notifications
Clear all

Using LCD Displays with Arduino

Page 2 / 3

Martin Richard
(@martin-richard)
Active Member
Joined: 7 months ago
Posts: 10
 

Thanks For The Replies i will try the suggestions when i next revisit the program

the suggestions the library is out of date and POSITVE is talking about the backlight makes sense

Best Regards And Thankyou

Martin


ReplyQuote
rdacosta
(@rdacosta)
Active Member
Joined: 7 months ago
Posts: 5
 

In this older sketch from 2018 I am trying to make it work for me.

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

I keep getting error--exit status 1,

'POSITIVE' was not declared in this scope'     And I don't know how to fix it.

If anyone can help I would be very grateful, since I'm new to this.

Thanks


ReplyQuote
noweare
(@noweare)
Estimable Member
Joined: 1 year ago
Posts: 108
 

Positive is located in LiquidCrystal_i2c.h around line 162 for my h file

 

/* PCF8574 backlight controls */
typedef enum : uint8_t
{
POSITIVE = 0x01, //backlight switching polarity
NEGATIVE = 0x00 //backlight switching polarity
}
backlightPolarity;


ReplyQuote
Sean451
(@sean451)
Trusted Member
Joined: 8 months ago
Posts: 69
 

Sorry if this question is self-evident, but is the LiquidCrystal_i2c.h included in the library?

--->Sean

(◕(' 人 ') ◕)


ReplyQuote
rdacosta
(@rdacosta)
Active Member
Joined: 7 months ago
Posts: 5
 

@sean451yes it is


ReplyQuote
Melbul
(@melbul)
Eminent Member
Joined: 9 months ago
Posts: 30
 

Check to see if POSITIVE is declared after the sketch is trying to use it?

 


ReplyQuote
rdacosta
(@rdacosta)
Active Member
Joined: 7 months ago
Posts: 5
 

@melbul      How do I show it as being declared? I'm very new at programming.


ReplyQuote
Melbul
(@melbul)
Eminent Member
Joined: 9 months ago
Posts: 30
 

Likewise, very new at this, but an issue is, if you call for variable before it has been set up, you will get that error.

The Arduino IDE lets you get away with setting your variables anywhere in the sketch but other IDe's won't!

 

 


ReplyQuote
rdacosta
(@rdacosta)
Active Member
Joined: 7 months ago
Posts: 5
 

@melbul    Thank you. I'll keep working on this.


ReplyQuote
etech_student
(@etech_student)
Active Member
Joined: 6 months ago
Posts: 9
 

None of the posts seem to me to offer a solution to my problem as to why, when I have copied the sketch and  pasted it faithfully in to my Arduino IDE it will not verify. Giving the error " 'POSITIVE' was not declared in this scope "

clearly as I see it 8 elements are declared in the Define LCD pinout statement       const int en = 2, rw = 1, rs = 0, d4 = 4, d5 = 5, d6 = 6, d7 = 7, bl = 3;             while the line                                                                             (i2c_LiquidCrystal_I2C lcdaddr, en, rw, rs, d4, d5, d6, d7, bl, POSITIVE);            contains 9 elements  surely this is incompatible.


ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 2 years ago
Posts: 1079
 

@etech_student

This issue has been discussed in another thread, but I can't seem to find it at the moment.  In fact I even looked into in that thread and tested the code and provided the solution.

I found that the newer versions of the libraries used would not work, but if you went backwards through the older versions, and I don't remember what version I finally landed on, but it would finally work just fine.

Bill even commented in the tread that he possibly needed to redo that lesson.  I personally hope he spends his time working on new material and leaves items like this as a "teaching" moment for users to "learn" how to "troubleshoot" their code.  Mainly because you'll find this issue many time going forward.

If I find that thread I'll reply again with a link to it.

SteveG


ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 2 years ago
Posts: 1079
 

@etech_student

I have a little egg on my face I guess.  I found the thread I was referring to, but it was actually about IR sensors and not LCD screens!  But I have a sneaking suspicion that the same issue of a newer library not functioning exactly the same as the library that was used back in 2018 when the lesson was published.

If I can carve out some extra time I'll take a look at it and see if I can help you out.

SteveG


ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 2 years ago
Posts: 1079
 

@etech_student

Can you go to the Library Manager in your Arduino IDE and provide us with the exact library you are using and the version number?  I'd like to be sure I'm using as close to exactly the same code as you are using to troubleshoot this issue.

SteveG


ReplyQuote
DroneBot Workshop
(@dronebot-workshop)
Workshop Guru Admin
Joined: 2 years ago
Posts: 1004
Topic starter  
Posted by: @codecage

Bill even commented in the tread that he possibly needed to redo that lesson.  I personally hope he spends his time working on new material and leaves items like this as a "teaching" moment for users to "learn" how to "troubleshoot" their code.  Mainly because you'll find this issue many time going forward

Thanks Steve, my thoughts exactly! 

@rdacosta I moved your post into the thread about the LCD Display video, where, as you can see, this has already been discussed.

Unfortunately, libraries, especially ones from coders other than Adafruit or Sparkfun, will get updated and often "break" code relying upon older versions.  This is one big advantage of using Platform IO instead of the Arduino IDE - your library version follows the project individually so you can "mix and match" versions.

In the PlatformIO article & video, I used the LiquidCrystal_PCF8574 library, which is a good choice if you are using the I2C backpack with the display.

😎

Bill

 

"Never trust a computer you can’t throw out a window." — Steve Wozniak


ReplyQuote
etech_student
(@etech_student)
Active Member
Joined: 6 months ago
Posts: 9
 

Where do I find the version number of the library.  It states it is compatible with the Arduino IDE 1.8.3 which is the version I am using and it was downloaded from  https://github.com/lucasmaziero/LiquidCrystal_I2C


ReplyQuote
Page 2 / 3