LCD Question

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!

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!

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

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.

PCWorxLA:

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!

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

Perhaps you are looking for something like:

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);
}

Thanks, exactly what I am looking for.

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

noblepepper:
Perhaps you are looking for something like:

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);
}

After the while loop

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

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 ?

noblepepper:
Perhaps you are looking for something like:

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);
}

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 :wink:

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

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 :wink: