LcdProgressBarDouble displays two progress bars in a single row of LCD display.
DependenciesThe LCD display must be previously initialized. This library uses LiquidCrystal library for displaying.
Expected resultExample 1: TimerRefer to full example: examples/DoubleTimer/DoubleTimer.ino.
Includes
#include <LiquidCrystal.h>
Initialization: instantiations
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
Initializing the progress bar
void initLpg()
{
startedMillis1 = millis();
startedMillis2 = startedMillis1;
//-- Set min and max values
lpg.setMinValues(startedMillis1);
lpg.setMaxValues(startedMillis1 + duration1, startedMillis2 + duration2);
//-- Draw it
lpg.draw(startedMillis1);
}
Drawing the progress bar
//-- draw progress bar
lpg.draw(currentMillis);
or via the alias drawValues (the LcdBarGraph way):
//-- draw progress bar
lpg.drawValues(currentMillis);
Example 2: Trimmer potentiometersRefer to full example: examples/DoubleBarPot/DoubleBarPot.ino.
Though the circuit is slightly more complex, the code is way easier!
Expected
Initializing the progress bar
//-- Set min and max values
//*** (0 is default minimum value)
//*** (1023 is maximum value for both bars)
lpg.setMaxValues(1023);
Drawing the progress bar
int r4 = analogRead(pinR4);
int r5 = analogRead(pinR5);
//-- draw progress bars
lpg.draw(r4, r5);
Major releases- v1.0.0: Initial release
- v1.0.3: Added support to display 1 bar only
- v1.1.0: Use of PROGMEM to save some RAM. Comment this line to prevent this behavior:
#define LCDPROGRESSBAR_USE_PROGMEM
Comments
Please log in or sign up to comment.