Skip to content
Wilfried Loche edited this page Jul 29, 2016 · 7 revisions

ℹ️ Copy of Arduino Wiki LcdProgressBar page

What is LcdProgressBar?

LcdProgressBar is an Arduino library for displaying a progress bar in LCD display.

Dependencies

The LCD display must be previously initialized. This library uses LiquidCrystal library for displaying.

Expected result

LcdProgressBar Demo

🎥 Video on Youtube

Example

ℹ️ Refer to full example: examples/Timer/Timer.ino, Breadboard and electronic schema here.

What you need is extracted bellow.

includes

#include <LiquidCrystal.h>
#include <LcdProgressBar.h> //## Include this lib

Initializations

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
LcdProgressBar lpg(&lcd, 1, 16);

Initializing the progress bar

void initLpg()
{
  //-- start time
  startedMillis = millis();

  //-- Set min and max values
  lpg.setMinValue(startedMillis);
  lpg.setMaxValue(startedMillis + duration);
}

Drawing the progress bar

  //-- draw progress bar
  lpg.draw(currentMillis);

or via the alias drawValue (the LcdBarGraph way 😉):

  //-- draw progress bar
  lpg.drawValue(currentMillis);

Authors and Contributors

Support or Contact