Go Down

Topic: LCD Question (Read 1 time) previous topic - next topic

bilica

Hi there,

Is it possible to show a timer running on a LCD attached to the 32U4 as soon as the Yun boots (power on) ?

I am asking this because I wanted to inform the user to be patient and display something. I guess I can display "Wait..." and then call Bridge.begin().

But I would rather have something dynamic being displayed.

Thanks!

PCWorxLA


Hi there,

Is it possible to show a timer running on a LCD attached to the 32U4 as soon as the Yun boots (power on) ?

I am asking this because I wanted to inform the user to be patient and display something. I guess I can display "Wait..." and then call Bridge.begin().

But I would rather have something dynamic being displayed.

Thanks!

Possible, sure. But that would be something that you would have to include in the setup() function of your sketch, and including the space needed for the LCD library, takes some precious space on your 32u4 side for your actual sketch.

Ralf

bilica

Thanks PCWorxLA,

I have managed to display text to the LCD before calling Bridge.begin().

However, when booting the arduino for the first time (on power), I get the same message stuck there for a whole minute.

I would like an alternative approach where, while the sketch waits for the linux side to boot, it also informs the user the elapsed time since power on, for instance.



Hi there,

Is it possible to show a timer running on a LCD attached to the 32U4 as soon as the Yun boots (power on) ?

I am asking this because I wanted to inform the user to be patient and display something. I guess I can display "Wait..." and then call Bridge.begin().

But I would rather have something dynamic being displayed.

Thanks!

Possible, sure. But that would be something that you would have to include in the setup() function of your sketch, and including the space needed for the LCD library, takes some precious space on your 32u4 side for your actual sketch.

Ralf

noblepepper

Perhaps you are looking for something like:

Code: [Select]
unsigned long now=0, timeDelay=74000, lastDisplayed=0;

void setup() {
  // put your setup code here, to run once:
  initDisplay();
  while (now < timeDelay){
    if (now - lastDisplayed > 1000){
      displayTimeLeft(timeDelay - now);
      lastDisplayed = now;
    }
    now = millis();
  }
}

void loop() {
  // put your main code here, to run repeatedly:

}

void initDisplay(){
  Serial.begin(115200);
  while (!Serial);
  Serial.println("Waiting for Linino to boot");
}

void displayTimeLeft(unsigned long time){
  Serial.println(time/1000);
}

bilica

Thanks, exactly what I am looking for.

However, where do I place Bridge.begin() so that the time keeps getting updated in the LCD ?


Perhaps you are looking for something like:

Code: [Select]
unsigned long now=0, timeDelay=74000, lastDisplayed=0;

void setup() {
  // put your setup code here, to run once:
  initDisplay();
  while (now < timeDelay){
    if (now - lastDisplayed > 1000){
      displayTimeLeft(timeDelay - now);
      lastDisplayed = now;
    }
    now = millis();
  }
}

void loop() {
  // put your main code here, to run repeatedly:

}

void initDisplay(){
  Serial.begin(115200);
  while (!Serial);
  Serial.println("Waiting for Linino to boot");
}

void displayTimeLeft(unsigned long time){
  Serial.println(time/1000);
}


noblepepper

After the while loop

bilica


So we will assume that it will always take 74s for the Yun to boot the Linux side ? What if it takes longer ?


Thanks, exactly what I am looking for.

However, where do I place Bridge.begin() so that the time keeps getting updated in the LCD ?


Perhaps you are looking for something like:

Code: [Select]
unsigned long now=0, timeDelay=74000, lastDisplayed=0;

void setup() {
  // put your setup code here, to run once:
  initDisplay();
  while (now < timeDelay){
    if (now - lastDisplayed > 1000){
      displayTimeLeft(timeDelay - now);
      lastDisplayed = now;
    }
    now = millis();
  }
}

void loop() {
  // put your main code here, to run repeatedly:

}

void initDisplay(){
  Serial.begin(115200);
  while (!Serial);
  Serial.println("Waiting for Linino to boot");
}

void displayTimeLeft(unsigned long time){
  Serial.println(time/1000);
}



noblepepper

I picked that mostly at random, intentionally not exactly 1 minute since there is no fixed time.

It really depends on what you consider "booted", up and running should definitely be done in 60 seconds, having established a connection to the internet takes longer and depends on external factors. You could put a script on the Linino side that monitors what you are interested in and reports back to the 32u4. All this is not your original question ;-)

bilica


Thanks noblepepper :) The question evolved on to other doubts :)


I picked that mostly at random, intentionally not exactly 1 minute since there is no fixed time.

It really depends on what you consider "booted", up and running should definitely be done in 60 seconds, having established a connection to the internet takes longer and depends on external factors. You could put a script on the Linino side that monitors what you are interested in and reports back to the 32u4. All this is not your original question ;-)

Go Up