# New Guy with LCD questions

#### animal

##### New Member
Thanks Clyde .I still get a error . I'll try to attach a copy
& tell Leonardo thanks too
animal

#### Attachments

• 9.8 KB Views: 2

#### Pommie

##### Well-Known Member
Assuming your LCD is the same as mine, lcd is defined as,
Code:
#define I2C_ADDR          0x3f        //Define I2C Address where LCD is -This probably needs to be 0x27.
#define BACKLIGHT_PIN      3
#define En_pin             2
#define Rw_pin             1
#define Rs_pin             0
#define D4_pin             4
#define D5_pin             5
#define D6_pin             6
#define D7_pin             7

LiquidCrystal_I2C lcd(I2C_ADDR, En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
Mike.

#### animal

##### New Member
Ok I added that code where I thought it should go & still error I'll try to send the code & the error
thanks
animal

#### Attachments

• 11.9 KB Views: 2
• 1.3 KB Views: 1

#### ClydeCrashKop

##### Well-Known Member
There were a couple lines that I thought I had pasted but didn't.
I edited that sketch. Try it again. It builds for me now.
Sorry.

#### Ian Rogers

##### User Extraordinaire
Forum Supporter
Assuming your LCD is the same as mine, lcd is defined as,
Code:
#define I2C_ADDR          0x3f        //Define I2C Address where LCD is -This probably needs to be 0x27.
#define BACKLIGHT_PIN      3
#define En_pin             2
#define Rw_pin             1
#define Rs_pin             0
#define D4_pin             4
#define D5_pin             5
#define D6_pin             6
#define D7_pin             7

LiquidCrystal_I2C lcd(I2C_ADDR, En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
Mike.
Err!! I thought it was an I2C LCD... Why do you need to define data pins..

#### Pommie

##### Well-Known Member
Some backpacks have different connection so the library allows you to define them. I think for most, the default will suffice.

Mike.

#### animal

##### New Member
Clyde thanks , did you attach the modified code ? another question when I see a line like this in a sketch
what does that mean ? I have only the 4 pins from my lcd backpak VCC,GND,SDA,SCL
thanks
animal

#### ClydeCrashKop

##### Well-Known Member
I corrected the sketch in post #20. Didn't want to leave bad info there.
I forgot these 2 lines.
// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);
It works and reads 5 volt square waves.
I don't know how accurate it is.

#### animal

##### New Member
I'm sorry for being a pain, I still get a error. I appreciate all the help so far. but the error is getting closer to the end of the code
thanks again
animal

#### Attachments

• 11.9 KB Views: 1
• 1.1 KB Views: 0

#### animal

##### New Member
ok I have the sketch verified , loaded no prob but nothing to the LCD . i re-ran the I2c scanner & a hello world sketch & they both work . si does that mean something is not initalized correctly for my LCD display ?
here is the code I got to load
thanks
animal

#### Attachments

• 980 bytes Views: 1

#### animal

##### New Member
ok . I'm kinda gettin this a bit . I have Tachometer on the LCD now . then it changes to "Please Press Button to Start" I have no button except the one on the UNO & that just resets the program . I'm gonna head out to the shop & work on some other stuff & think bout this . I know I'm gettin real close & thanks again for all your help !!!!
animal

#### animal

##### New Member
my bad, had a brain fart ( happens more often than less ) I was so focused on the first part of the project , I forgot all about the motor part .
thanks again for all the help. I was gettin close to pullin my hair out . of all of the projects I've tried cept for Hello world & I2c scanner
this is the furthest I've gotten . wish I had found this forum a few months ago
thanks again

animal