i was frequently working on Arduino. I have completed two programs successfully using LCD1605, when I uploaded my third program the display started to show symbols after some time it is not displaying.
Are you correctly addressing the LCD? Next, what baud rate are you using? Your serial monitor needs to set for the correct baud rate used in your code. The code you neglected to post.
Ron
#include <LiquidCrystal.h>
int rs = 7;
int en = 8;
int d4 = 9;
int d5 = 10;
int d6 = 11;
int d7 = 12;
LiquidCrystal lcd(rs,en,d4,d5,d6,d7);
int s = 1000;
float a;
float b;
String c;
float answer;
void setup() {
// put your setup code here, to run once:
lcd.begin(16,2);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
lcd.setCursor(0,0);
lcd.print("Enter your first");
lcd.setCursor(0,1);
lcd.print("number:");
while(Serial.available() == 0){
}
a = Serial.parseFloat();
lcd.clear();
lcd.setCursor(0,0);
lcd.print(a);
delay(s);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Enter your");
lcd.setCursor(0,1);
lcd.print("second number:");
while(Serial.available() == 0){
}
b = Serial.parseFloat();
lcd.clear();
lcd.setCursor(0,0);
lcd.print(b);
delay(s);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Enter your");
lcd.setCursor(0,1);
lcd.print("operation:");
while(Serial.available() == 0){
}
c = Serial.readString();
lcd.clear();
lcd.setCursor(0,0);
lcd.print(c);
delay(s);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Your answer");
lcd.setCursor(0,1);
lcd.print("is:");
delay(s);
if (c == "+"){
answer = a + b;
}
if (c == "-"){
answer = a - b;
}
if (c == "*"){
answer = a * b;
}
if (c == "/"){
answer = a / b;
}
lcd.clear();
lcd.setCursor(0,0);
lcd.print(a);
lcd.print(c);
lcd.print(b);
lcd.print(" = ");
lcd.print(answer);
Serial.println(answer);
lcd.setCursor(0,1);
lcd.print("Thank you");
delay(3000);
lcd.clear();
}
this is my code
thanks bro.
I suggest that you redo your soldering.
Your topic has beem moved to a more suitable location on the forum.
Question (no hard feelings): we like to understand why you posted your topic in the IDE 1.x category? Reason for asking is that it might help us to make it clearer to users where to post.
Was it R3 or a loose wire?
loose wire I think so
I really don't know about it. I am a newbie
I am again having a problem with my LCD
type or paste the code here
#include <LiquidCrystal.h>
int rs = 12;
int en = 11;
int d4 = 5;
int d5 = 4;
int d6 = 3;
int d7 = 2;
LiquidCrystal lcd(rs,en,d4,d5,d6,d7);
int s = 1000;
float a;
float b;
String c;
float answer;
void setup() {
// put your setup code here, to run once:
lcd.begin(16,2);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
lcd.setCursor(0,0);
lcd.print("Enter your first");
lcd.setCursor(0,1);
lcd.print("number:");
while(Serial.available() == 0){
}
a = Serial.parseFloat();
lcd.clear();
lcd.setCursor(0,0);
lcd.print(a);
delay(s);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Enter your");
lcd.setCursor(0,1);
lcd.print("second number:");
while(Serial.available() == 0){
}
b = Serial.parseFloat();
lcd.clear();
lcd.setCursor(0,0);
lcd.print(b);
delay(s);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Enter your");
lcd.setCursor(0,1);
lcd.print("operation:");
while(Serial.available() == 0){
}
c = Serial.readString();
lcd.clear();
lcd.setCursor(0,0);
lcd.print(c);
delay(s);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Your answer");
lcd.setCursor(0,1);
lcd.print("is:");
delay(s);
if (c == "+"){
answer = a + b;
}
if (c == "-"){
answer = a - b;
}
if (c == "*"){
answer = a * b;
}
if (c == "/"){
answer = a / b;
}
lcd.clear();
lcd.setCursor(0,0);
lcd.print(a);
lcd.print(c);
lcd.print(b);
lcd.print(" = ");
lcd.print(answer);
Serial.println(answer);
lcd.setCursor(0,1);
lcd.print("Thank you");
delay(3000);
lcd.clear();
}
)
I am getting this output after entering "c"
in the serial monitor```
Let's back up. Load "Hello World" under File -> Examples -> LiquidCrystal -> HelloWorld.
Does that work? It should display Hello World and an incrementing number
It is displaying correctly. On the other hand, when uploading the above program or other programs which take input from the serial monitor it shows the above symbol after the input value. Then the program comes to its initial stage.
Set the monitor to "No line ending"
Did that solve your problem?
If not, we need to revisit loose connections
Solved. When I connect it to Arduino Nano it is not displaying anything. Is it need to change the code for Arduino Nano?
thanks for the help
Did you select Nano as the board being programmed?
As suggested 6 days ago, you probably should reflow your solder joints. You don't have good wetting on the pads. You need to heat the pads and pins evenly but don't overheat them. Slide your iron tip up the lead when you remove it.
I'm afraid those poor solder joints will plague you until they are corrected.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.