Lcd boot up message

Hello guys!

Iam searching the net and the forums but i cant find a solution. I would like to make a welcome message before the main code starts.
So for example when you power up arduino i would like to see "welcome!" And after a short time like 2-4 sec later the main code starts so for example welcome 2 sec later lcd display shows data
I have got arduino uno and a 16x2 lcd.
Where can i find some info for coding or someone can help me with this?

Thanks Ricsi!

Put the boot splash code in setup()

void setup(){

   //  Whatever other setup code needs to come first for your stuff

    randomSeed(analogRead(0));   //   seed random number generator

    int time = random(2000, 4001);   // get random number between 2000 and 4000 for the 2-4 seconds

    // code to display your splash screen goes here

   delay(time);  // wait for the 2 to 4 seconds

   //  Whatever other code the rest of your setup needs. 
}

void loop(){

  // main code here
}

When you want something to happen only once at the beginning then it goes in the setup function. It would be easier if you just had a set time instead of the 2 to 4 seconds thing. But whatever floats your boat.

Hello guys
Thanks for quick help i just started programmint arduino.as soon as possible i will try to make this in the program
What do you mean its easier to have set time than 2 4 secs?

(deleted)

Ricsi168:
And after a short time like 2-4 sec later the main code starts

You said it had to happen 2 to 4 seconds later. It would be easier to code if it had to happen at a set time like say 3 seconds later instead of the range of values. Picking a random number out of the range added some extra code.

It was a rather tongue in cheek way of trying to tell you to be more specific when you start giving specifications for a program.

Ahh okay its not a problem 3 sec is good for me i will try to make it work! :smiley: thank you very much!
above that code is a random time? OR how can i do with fixed time like 3 sec or something like that?

#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
randomSeed(analogRead(0)); // seed random number generator

int time = random(3000, 5001); // get random number between 3000 and 5000 for the 3-5 seconds

// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print(“Welcome!”);

delay(time); // wait for the 2 to 4 seconds

// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("pressure ");
}

void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print a message to the lcd.
lcd.print("Temp: 36 "); lcd.print( char( 223)); lcd.print("C ");
}

So its working but can i make it easier by fix time? like 3…5…8…sec but how can i get fixxed time welcome message?

IF you want a fixed time then you obviously don’t need the random stuff. Come on man, think a little.

#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {

    //  set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("Welcome!");

   delay(3000);  // wait for 3 seconds

  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("pressure ");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print a message to the lcd.
  lcd.print("Temp:   36  "); lcd.print( char( 223)); lcd.print("C  ");
}

I think you may have missed my point. I was trying to get you to realize that you should be more specific when laying out specifications for a program. I guess it just went over your head.

You should also go read the “How to use this forum - please read” thread at the top of any board. Programming really is an area where willingness to read the instructions is crucial.

Thank you very much i just started this programming arduino stuff like 3 days ago i would like to make a pressure and temperature meter with lcd display so its very hard to understand this but thanks for reply and help me out!!

Ricsi168:
Thank you very much i just started this programming arduino stuff like 3 days ago i would like to make a pressure and temperature meter with lcd display so its very hard to understand this but thanks for reply and help me out!!

Maybe you should consider a simpler project to start with…