Go Down

Topic: Need help for a special LCD function (Read 373 times) previous topic - next topic


I'm i an middle of an amplifier project, and this amp is going to have an i2c driven LCD.
I've hooked it up, and got everything working, but i have one issue. (i'm using the LiquidCrystal_i2c.h library)
when the amp is running normally, the LCD is showing the source (AUX, CD, TAPE etc.), but when I turn up the volume (with a remote or a rotary switch) I want the LCD to show "Vol: x". the thing is that I want the current volume to be shown i a couple of seconds, and then turn back to normal (show the source input). if I continue ut adjust the volume while the LCD is showing "Vol: x", the LCD updates and print immediately the new volume value "Vol: x+-1"

if I write:

          lcd.print("Vol: ");

It's not possible to adjust the volume before the arduino have waited 1500ms.

Here is a video of my old amp, showing exactly what I mean:



You need to take a look at the BlinkWithoutDelay example.

Record the time when you adjust the volume, and when that time differs from the current time by 2 seconds (or whatever you choose) switch the display back to the source display.

Personally I usually have a "display mode" variable which defines what should be shown at the time, then a function which displays what should be displayed depending on the display mode selected.  Then the main routine just selects a different display mode as and when it needs to.


I've looked at the blink without delay sketch, but how should I imliment it? do you have an example I can work on?


but how should I imliment it?

The same way it was done in the example.

do you have an example I can work on?

Didn't you just look at one?

Write down, in words, not code, what you need to do, and when you need to do it. Translating that to code is easy. Knowing what to do is the hard(er) part. It's time for you to demonstrate that you DO know what needs to be done.


Please post your whole program so that we can give advice on how to implement timing using millis()
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131