Pages: [1]   Go Down
Author Topic: Displaying on LCD  (Read 1485 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 1
Posts: 110
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear all,
I am trying to display some information on the LCD, such as

Choose setup
Press A for
entering amount
....

I have used the following code:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);    //rs,rw,enable,d4,d5,d6,d7

void setup()
{
  Serial.begin(9600);   
 
 
}
void loop()
{
   Display();
 
}

void Display()
{
  lcd.begin(16,2);                        //initialise lcd
  lcd.noCursor();
  lcd.print("Choose Setup");              //display on lcd
  //delay(100);
 // lcd.clear();
  lcd.print("Press A for ");
  //delay(100);
  //lcd.print("entering amount");
  //lcd.print("needed by keypad");
}


And when inserting the delay it doesnt show coorrect

What am I doing wrong?
Thank you





Logged

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1643
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Please use the CODE button  "#' when posting code.

Code:
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);    //rs,rw,enable,d4,d5,d6,d7

void setup()
{
  Serial.begin(9600);  
  lcd.begin(16,2);                        //initialise lcd
  lcd.noCursor();
 
}
void loop()
{
   Display();
 
}

void Display()
{

  lcd.print("Choose Setup");              //display on lcd
  //delay(100);
 // lcd.clear();
  lcd.print("Press A for ");
  //delay(100);
  //lcd.print("entering amount");
  //lcd.print("needed by keypad");
}

I will start by saying you are constantly initializing your display... which only needs to happen once... in the setup() block

So, put these lines below in setup(), since constantly initializing the display in the loop() block adds unnecessary delay and confusion to your current problems...
Quote
lcd.begin(16,2);                        //initialise lcd
lcd.noCursor();
« Last Edit: February 02, 2011, 07:27:35 am by pwillard » Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 110
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok I did wat you said, but now the LCD just keeps displaying the sentences together and dont stop.
This is my arranged code


#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);    //rs,rw,enable,d4,d5,d6,d7

void setup()
{
  Serial.begin(9600);   
  lcd.begin(16,2);
//  lcd.noCursor();
 
 
}
void loop()
{
   Display();
 
}

void Display()
{
 
  lcd.print("Choose Setup");              //display on lcd
  //delay(100);
 // lcd.clear();
  lcd.print("Press A for ");
  delay(100);
  //lcd.print("entering amount");
  //lcd.print("needed by keypad");
}
Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 110
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Took care of everything.

Am new to arduino thats y had a lot of wrong things.

Thank you
Logged

Pages: [1]   Go Up
Jump to: