• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

New Guy with LCD questions

Pommie

Well-Known Member
Most Helpful 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.
 

ClydeCrashKop

Well-Known Member
Most Helpful 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
Most Helpful 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.
Err!! I thought it was an I2C LCD... Why do you need to define data pins..
 

Pommie

Well-Known Member
Most Helpful 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
LiquidCrystal_I2C lcd(I2C_ADDR, En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
what does that mean ? I have only the 4 pins from my lcd backpak VCC,GND,SDA,SCL
thanks
animal
 

ClydeCrashKop

Well-Known Member
Most Helpful 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
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

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
 

Latest threads

EE World Online Articles

Loading

 
Top