Skip to main content
added 2 characters in body
Source Link

I have connected arduino nano every to my lcd display. It works perfect when i put all my code in setup() part. But when i put the code in loop() it does werid things. I have to put my code in loop(), because i am reading from load cell and displaying the values that are constantly changing. The delay can't be more than 250 ms.

This works well.

int Contrast=40;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);  
 
void setup(){
    analogWrite(6,Contrast);
    lcd.begin(16, 2);
    lcd.setCursor(0, 0);
    lcd.print("testing");
} 
  
void loop(){ 


 } 
#include <LiquidCrystal.h> 
int Contrast=30;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);  
 
void setup(){
    analogWrite(6,Contrast);
    lcd.begin(16, 2);
    lcd.setCursor(0, 0);
    lcd.print("testing");
} 
  
void loop(){ 


 } 

When I do this next thing it works well for few seconds and then it starts to display random weird characters and stops displaying anything after some time.

#include <LiquidCrystal.h> 
int Contrast=30;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);  
 
void setup(){
    analogWrite(6,Contrast);
    lcd.begin(16, 2);
    lcd.setCursor(0, 0);
    
} 
  
void loop(){
  
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print(millis()/1000);
  delay(250);
 }

I have tried removing lcd.clear() it didn't help. I thought it was a problem with wiring first, but it's not. What am I doing wrong?

Any help would be great, thanks.

I have connected arduino nano every to my lcd display. It works perfect when i put all my code in setup() part. But when i put the code in loop() it does werid things. I have to put my code in loop(), because i am reading from load cell and displaying the values that are constantly changing. The delay can't be more than 250 ms.

This works well.

int Contrast=40;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);  
 
void setup(){
    analogWrite(6,Contrast);
    lcd.begin(16, 2);
    lcd.setCursor(0, 0);
    lcd.print("testing");
} 
  
void loop(){ 


 } 

When I do this next thing it works well for few seconds and then it starts to display random weird characters and stops displaying anything after some time.

#include <LiquidCrystal.h> 
int Contrast=30;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);  
 
void setup(){
    analogWrite(6,Contrast);
    lcd.begin(16, 2);
    lcd.setCursor(0, 0);
    
} 
  
void loop(){
  
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print(millis()/1000);
  delay(250);
 }

I have tried removing lcd.clear() it didn't help. I thought it was a problem with wiring first, but it's not. What am I doing wrong?

Any help would be great, thanks.

I have connected arduino nano every to my lcd display. It works perfect when i put all my code in setup() part. But when i put the code in loop() it does werid things. I have to put my code in loop(), because i am reading from load cell and displaying the values that are constantly changing. The delay can't be more than 250 ms.

This works well.

#include <LiquidCrystal.h> 
int Contrast=30;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);  
 
void setup(){
    analogWrite(6,Contrast);
    lcd.begin(16, 2);
    lcd.setCursor(0, 0);
    lcd.print("testing");
} 
  
void loop(){ 


 } 

When I do this next thing it works well for few seconds and then it starts to display random weird characters and stops displaying anything after some time.

#include <LiquidCrystal.h> 
int Contrast=30;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);  
 
void setup(){
    analogWrite(6,Contrast);
    lcd.begin(16, 2);
    lcd.setCursor(0, 0);
    
} 
  
void loop(){
  
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print(millis()/1000);
  delay(250);
 }

I have tried removing lcd.clear() it didn't help. I thought it was a problem with wiring first, but it's not. What am I doing wrong?

Any help would be great, thanks.

Source Link

Arduino lcd displays random chracters

I have connected arduino nano every to my lcd display. It works perfect when i put all my code in setup() part. But when i put the code in loop() it does werid things. I have to put my code in loop(), because i am reading from load cell and displaying the values that are constantly changing. The delay can't be more than 250 ms.

This works well.

int Contrast=40;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);  
 
void setup(){
    analogWrite(6,Contrast);
    lcd.begin(16, 2);
    lcd.setCursor(0, 0);
    lcd.print("testing");
} 
  
void loop(){ 


 } 

When I do this next thing it works well for few seconds and then it starts to display random weird characters and stops displaying anything after some time.

#include <LiquidCrystal.h> 
int Contrast=30;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);  
 
void setup(){
    analogWrite(6,Contrast);
    lcd.begin(16, 2);
    lcd.setCursor(0, 0);
    
} 
  
void loop(){
  
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print(millis()/1000);
  delay(250);
 }

I have tried removing lcd.clear() it didn't help. I thought it was a problem with wiring first, but it's not. What am I doing wrong?

Any help would be great, thanks.