system
February 2, 2011, 12:20pm
1
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
Please use the CODE button "#' when posting 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...
lcd.begin(16,2); //initialise lcd
lcd.noCursor();
system
February 2, 2011, 12:57pm
3
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");
}
system
February 2, 2011, 1:33pm
4
Took care of everything.
Am new to arduino thats y had a lot of wrong things.
Thank you