How to avoid continues flicker in LCD

void GetEditPassword(int password_data[],int size)
{

  lcd.setCursor(0,0);
 lcd.print("ENTER PASSWORD  ");
 
lcd.setCursor(0,1);
  lcd.print(password_data[0]);
   lcd.print(password_data[1]);
    lcd.print(password_data[2]);
     lcd.print(password_data[3]);
     lcd.print("              ");
  
}

simillarly

void Display_coordinate()
 {

lcd.setCursor(0,0);
lcd.print("Latitude:");
lcd.print(latitude);
lcd.setCursor(0,1);  
lcd.print("Longitude:");
lcd.print(longitude);
   
 }

I Have completed my coding. I am facing small issue.Since my code size is big i cant paste my code. I am calling from loop. If you see my code I am setting Setcursor (0,0) and setCursor(0,1); when every time function called the lcd set cursor because of which i am seeing letter fluctuation at back end, SO is there any way to stop it. when i comment the first line lcd.setCursor(0,0);.it stopped flicker But how to stop lcd.setCursor(0,1);.

I am calling from loop.

This means that you are repeatedly writing to the LCD as fast as the processor can send information to it.

You can alleviate the problem by (1) slowing things down and (2) not rewriting information that does not change - such as the words "Latitude" and "Longitude".

Don

I just given example here. some of permeter wont change and some parameter like angle will change.to slow down process i used The counter and Write into LCD.Somehow i attached complete code . The LCD related program are avilable in LCD.c,LCD_action & lCD.h .

Once i increase counter it stopping . Let me know what changes need to be made.

NRDV3.zip (21.6 KB)

something like this work? I couldn't check or compile your code.

#include <LiquidCrystal.h>

#include <DS1307RTC.h>
#include <Event.h>
#include <Timer.h>
#include "config.h"
#include "mode.h"
#include"timecalc.h"
#include"lcd.h"
#include"pos.h"
#include"spa.h"
#include"glob.h"
#include "actuator.h"
#include "rtc.h"
#include "diag.h"
#include "hwconfig.h"
#include "diag.h"
#include <Time.h>
#include <avr/wdt.h>
Timer t;
#include"print.h"
//#include <MsTimer2.h>
#include"wind.h"

// ADDED CODE LINES
int PreviousLatitude = 0;
int PreviousLongitude = 0;
// ADDED CODE LINES

static int Lcd_counter=0;

LiquidCrystal lcd(12, 11, 4, 5, 6, 7);
void flash() {
  static boolean output = HIGH;
  digitalWrite(20, output);
  output = !output;
  
}

void setup()
{
  pinMode(led,OUTPUT);
  Serial.begin(9600);
  //  setSyncProvider(RTC.get);   // the function to get the time from the RTC
  //  setupActuator();
  wdt_enable(WDTO_8S);
  MODE=INIT;


  pinMode(backLight, OUTPUT);
  pinMode(beeper, OUTPUT);
  digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.
 rtcSetup();
lcdClear();
Serial.println("MODE,DIR,Date, month,year ,hh,mm,sec,MODE,Desired_Angle,Actual_Angle,Wind_speed,Wind_KMPH");
Serial.println("............................................................................");
}


void loop()
{

// ADDED CODE LINES
if ( PreviousLatitude != latitude || PreviousLongitude != longitude ) {
  LCD_Display();
  PreviousLatitude = latitude;
  PreviousLongitude = longitude;
}
// ADDED CODE LINES

CHK_Key();
wdt_reset();
Track_loop();
//Serial.println("..........................");

}


void Track_loop()
{
  calcPos(); 
  calcTime();
  calcElevationAngle();
  callMode();
  actuate();
  // checkHWFaults();
  Wind_calc();
  Print_Result(); 

}

void Print_Result()
{
  /*
  Print_Date();
   Print_Time();
   show("zenith",zenith,true);
   show("azimuth",azimuth,true);
   show("latidude",latitude,true); // dude or tude???
   show("longitude",longitude,true);
    show("Elevation",elevation,true);
   show("Converted Elevation",conv_elevation,true);
 show("Tracker_Desire",tracker_des_angle,true);
 show("Traker_Actual:",tracker_actual_pos,true);
 show("Wind_SPEED m/s:",Wind_Speed,true);
 show("WIND_SPEED KMPH:",Wind_Kmph,true);  
*/

Serial.print(MODE); Serial.print(","); Serial.print(DIR);Serial.print(",");
Serial.print(local_day); Serial.print(","); Serial.print(local_month); Serial.print(",");Serial.print(local_year);Serial.print(",");
Serial.print(local_h); Serial.print(","); Serial.print(local_m); Serial.print(",");Serial.print(local_s);Serial.print(",");
Serial.print(tracker_des_angle); Serial.print(","); Serial.print(tracker_actual_pos); Serial.print(",");Serial.print(Wind_Speed);Serial.print(",");
Serial.println(Wind_Kmph); 



}