Do you have a minimal example that reproduces the problem?
Yes, sure:
1. Generate the Arduino project using your template.
2. Add https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home (https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home) - LiquidCrystal library into the "libraries" sub dir of the project.
3. Resulting code:
#include <Arduino.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
/*
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
LiquidCrystal_I2C lcd(0x3F,2,1,0,4,5,6,7) ;
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
lcd.
}
void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(1000); // wait for a second
}
I also added references to the library (absolute path ) in the project->build->Search Directories-> Linker and project->build->Search Directories->compiler.
I still can't build the project, but i'm not sure if these two issues are related.
Keep in mind that we use our own parser of c++, which is not fully complete and doesn't support all features of the language.
So if it works in another tool doesn't mean it will work in codeblocks.
To find which part of the library causes the problem:
Copy the text of the header file in the main.cpp and start removing code until you've found the problematic piece.
Thank you for the instructions!
I think i do not know what is the proper workflow to add the libraries to the CB.
I thought that i add the path to library folder ( lets say i have a "lib" subfolder in a project directory structure:
Prj1
|
|-> src
| -> main.cpp
|->lib
|-> Lib1
|-> superlib.cpp
|-> superlib.h
)
I need to add "lib" into "Search directories -> Linker/Compiler" and "reparse the project".
But it appears that i should restart the CB?
And here is the minimum code that somehow affects the autocomplete:
#include <NewliquidCrystal/LCD.h>
//#include "NewliquidCrystal/LCD.h"
class LiquidCrystal_I2C : public LCD
{
LiquidCrystal_I2C (uint8_t lcd_Addr);
int init();
};
LiquidCrystal_I2C abc(000);
abc.
once you type "abc." - no popups, no errors would show up. If i type "in" i'll get a nice and correct information about the "init()" method.
This behavior ( i have to type 2 symbols of the method to get a popup) is consistent with the original LiquidCrystal_I2C class.
At the same time, if i were to declare a var of LCD ( LCD.h) the popup will shouw up with all available methods immediately after i put a "."
the only difference i see between these two classes is that one (crystal) is a child of LCD whereas LCD is a child of the PRINT - "standard" library.