Jump to content

Arduino Error

piemadd
Go to solution Solved by .spider.,

LiquidCrystal_I2C lcd(0x27,16,2);

 

If I am using the right library I'd say add a  space between I2C and lcd

 

 

So, I got an Arduino UNO for chistmas, and i am having some trouble. I am using the LiquidCyrstal_I2C library to use with my 16x2 lcd display.

 

The code follows:

#include<LiquidCrystal_I2C.h>
char array1[]="ImplosiveTech   ";
char array2[]="hello world     ";
int tim=250;
LiquidCrystal_I2Clcd(0x27,16,2);
void setup()
{lcd. init();
lcd. backlight();}
void loop()
{lcd. setCursor(15,0);
for(int positionCounter1=0;positionCounter1<26;positionCounter1++)
{lcd.scrollDisplayLeft();
lcd.print(array1[positionCounter1]);
delay(tim);}
lcd. clear();
lcd. setCursor(15,1);
for(int positionCounter=0;positionCounter<26;positionCounter++)
{lcd.scrollDisplayLeft();
lcd.print(array2[positionCounter]);
delay(tim);}
lcd. clear();}

I am getting the following error:

Quote

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

custom1.ino:5: error: expected constructor, destructor, or type conversion before '(' token

 LiquidCrystal_I2Clcd(0x27,16,2);

                     ^

custom1.ino:6: error: expected declaration before '}' token

 }

 ^

Multiple libraries were found for "Wire.h"
 Used: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire
 Not used: C:\Users\Luca\Documents\Arduino\libraries\Wire
Multiple libraries were found for "LiquidCrystal_I2C.h"
 Used: C:\Users\Luca\Documents\Arduino\libraries\LiquidCrystal_I2C
 Not used: C:\Users\Luca\Documents\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master
exit status 1
expected constructor, destructor, or type conversion before '(' token

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

Halp?!!?!

 

-Implosive

i like trains 🙂

Link to comment
Share on other sites

Link to post
Share on other sites

LiquidCrystal_I2C lcd(0x27,16,2);

 

If I am using the right library I'd say add a  space between I2C and lcd

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×