I want to display LCD char for every 10 seconds.

Anyone could help me to make that happens? Thanks

I'm working on LCD stuff now do you have any code to help you with your problems. I need to see what you have now to be able to further assist you.

Welcome.

We really need a bit more information.

this is just my code that included the lcd

lcd.setCursor(0,1); lcd.print ("Time Passed = "); lcd.setCursor(14,1); lcd.print(s);

if (s==10){ // this is where actually I want to make it happen every 10 seconds lcd.clear(); lcd.setCursor(0,0); lcd.print("Average BPM:"); lcd.print(" "); lcd.setCursor(13,0); lcd.print(data[3]-10); delay(3000); lcd.clear();

//counter up ms++; delay(100); if(ms==10){ ms=0; s++; }

I really appreciated it if you could help me, I'm working on my final project now :)

Well your counter should not be in the if s == 10 and this is not the right way to do so

Best is to have a lastTime value, compare to current time and if more than 10 second do the LCD display and record lastTime to be current time

I find that lcd are messy when you try to refresh them too fast but delay() can mess up your sequences as promised I have been working on some code for my project and so I put together parts of my code with yours to give you a great start :slight_smile:
There are 2 ways to do this one is what I am doing which has some great advantages but it is complex. the second is simpler. I commented out the complex version if it is too much just delete it.
If you want to try out the complex version just un-comment it and comment out the basic version.
The most important thing is to have a quick but not too fast LCD refresh without slowing down or messing with the rest of your code. using no delay timers i was able to do this.

#include <LiquidCrystal.h>
unsigned long seconds = 10; // Data update interval in seconds
int  DisplayValue = 100;
unsigned long timer, lcdTimer;
LiquidCrystal lcd(7, 6, 5, 4, 3, 2); // My LCD hookup config
void setup() {
  lcd.begin(16, 2);
  lcd.noCursor();

}
// this commented code has better formatting and doesn't spam the LCD when there isn't changes but it is much more advanced
/*
  void loop() {

   if ( (unsigned long)(millis() - lcdTimer) >= (100)) { // refreshes the LCD Display if changes every 100 miliseconds
    char Str [2][16] = {{"               "}, {"               "}};
    static char CopyStr[2][17];
    lcdTimer = millis();

    memcpy ( Str[0], "Average BPM:    ", 16); // copying a string of characters we do noth want the \0 character to be coppied so we use memcpy
    dtostrf((float)DisplayValue, 4, 0, Str[0] + 12); // Formats the number and shifts it to the right
    memcpy ( Str[1], "Time Passed:    ", 16); // copying a string of characters we do noth want the \0 character to be coppied so we use memcpy
    dtostrf((millis()*.001), 4, 1, Str[1] + 12); // Formats the number and shifts it to the right
    if ( strcmp ( CopyStr[0], Str[0] ) != 0 || strcmp ( CopyStr[1], Str[1] ) != 0) { // if something changed update the display
      lcd.clear();
      for (int col = 0; col < 16; col++)lcd.write((uint8_t)Str[0][col]); // Send the characters to the display
      lcd.setCursor(0, 1);
      for (int col = 0; col < 16; col++)lcd.write((uint8_t)Str[1][col]); // Send the characters to the display
      strcpy ( CopyStr[0], Str[0] );
      strcpy ( CopyStr[1], Str[1] );
    }
  }

  if ( (unsigned long)(millis() - timer) >= (seconds * 1000)) { // updates your data every 10 seconds
    timer = millis();
      DisplayValue = DisplayValue - 10;
          // DisplayValue = data[3]-10
  }
}

*/

// Start with this code to see how well it works for you 
void loop() {

  if ( (unsigned long)(millis() - lcdTimer) >= (100)) { // refreshes the LCD Display if changes every 100 miliseconds
    lcdTimer = millis();
    lcd.clear();
    lcd.setCursor(0, 1);
    lcd.print ("Time Passed = ");
    lcd.setCursor(14, 1);
    lcd.print((int)lcdTimer * .001); // seconds passed

    lcd.setCursor(0, 0);
    lcd.print("Average BPM:");
    lcd.print("   ");
    lcd.setCursor(13, 0);
    lcd.print(DisplayValue);
  }

  if ( (unsigned long)(millis() - timer) >= (seconds * 1000)) { // updates your data every 10 seconds
    timer = millis();
    DisplayValue = DisplayValue - 10; //<<< for testing
    // DisplayValue = data[3]-10
  }
}