Hi all.
Can anyone help with the above error message. I cannot upload my sketch because when i try to, i get a message saying that i have exceeded 9000 characters, likewise with the full error message, or am i doing something else wrong ?
Regards
Ray
My guess is that you used a the word "POSITIVE" in your program without defining it. What do you expect POSITIVE to be?
And you should read the sticky "How to use this forum - please read".
You can attach your code to a post.
If the error message is too big, same story. Or analyse your error message, throw the none-relevant information away and post it.
I suspect that this refers to an I2C LCD library. Which one and how did you install it?
If you did define "POSITIVE", you probably defined it in one function and you are trying to use it in another.
Defining it globally should fix it.
You can attach your file if it is too big to include inline.
A program more than 9000 characters long implies to me that it is large and complicated. If you did the sensible thing and wrote it in sections and tested it as you went along then you must know at which point the error started to occur. Go back to a version that compiles (you do have previous versions, don't you ?) and review what you added afterwards.
If you are getting this error and don't understand it, you are a new programmer. New programmers really oughtn't be trying to debug 9k of other people's code.
I suggest that rather than copy/paste some code off the web that you don't understand and try to make it go by peppering this forum with questions, you click the 'resources' link at the top of this webpage and have a look at 'getting started' and 'tutorials'.
I'd also suggest googling 'C++ tutorial' and doing the first few lessons of a C++ tutorial, keeping in mind that there are a couple of things specific to arduino that a general language tutorial won't address.
Hi.
Thanks for all your help, my problem was indeed the i2c library.
The criticisms made regarding cut and paste of other peoples sketches, well, i see no problem with it, the original authors obviously wanted to share their work with others or they would not go public, and publish their work on the Internet.
gresleyman:
The criticisms made regarding cut and paste of other peoples sketches, well, i see no problem with it, the original authors obviously wanted to share their work with others or they would not go public, and publish their work on the Internet.
That's not the problem. The problem is copying code that you don't understand. Either understand it before blindly copying it, or find alternative, simpler code that you do understand.
Try this program with this library:
#include<LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup()
{
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("OK!");
}
void loop()
{
}
Peiter
When i copied the code off the Internet, i thought i did understand it, what i did not know is that there seems to be some very different libraries out there for i2c LCD's, with guidance from sterretje it was a simple matter to rectify the problem.
Ray
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Addr, En, Rw, Rs, d4, d5, d6, d7, backlighpin, polarity
void setup()
{
lcd.begin(16,2);
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Hello world!");
lcd.setCursor(0, 1);
lcd.print("Row number: ");
lcd.setCursor(12, 1);
lcd.print("2");
}
void loop()
{
}
JOHNITEC:
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Addr, En, Rw, Rs, d4, d5, d6, d7, backlighpin, polarity
void setup()
{
lcd.begin(16,2);
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Hello world!");
lcd.setCursor(0, 1);
lcd.print("Row number: ");
lcd.setCursor(12, 1);
lcd.print("2");
}
void loop()
{
}
And ??
Is there a problem?
2)
Did you read the replies referring to different versions of the library?
3)
Please read How to use this forum - please read, specifically point 7 about posting code.