Notifications
Clear all

I2C Demo Sketch 2018  


rdacosta
(@rdacosta)
Active Member
Joined: 1 week ago
Posts: 5
Topic starter  

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


Quote
noweare
(@noweare)
Trusted Member
Joined: 10 months ago
Posts: 92
 

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)
Eminent Member
Joined: 1 month ago
Posts: 44
 

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

--->Sean

(◕(' 人 ') ◕)


ReplyQuote
rdacosta
(@rdacosta)
Active Member
Joined: 1 week ago
Posts: 5
Topic starter  

@sean451yes it is


ReplyQuote
Melbul
(@melbul)
Active Member
Joined: 2 months ago
Posts: 14
 

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

 


ReplyQuote
rdacosta
(@rdacosta)
Active Member
Joined: 1 week ago
Posts: 5
Topic starter  

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


ReplyQuote
Melbul
(@melbul)
Active Member
Joined: 2 months ago
Posts: 14
 

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: 1 week ago
Posts: 5
Topic starter  

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


ReplyQuote