กลับไปหน้ารวมไฟล์
lcdprogressbar-845b29-en.md

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

2 seconds progress bar, looping

Example

Refer to full example: examples/Timer/Timer.ino.

Includes

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

Initialization: instantiations

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

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

EXPANDED TECHNICAL DETAILS

Visual Progress Telemetry

LcdProgressBar provides a professional-grade graphical interface for tracking hardware processes, file uploads, or sensor calibration on standard character LCDs.

  • Custom Character Definition: Standard LCDs (like the HD44780) only display text. This project uses the Arduino's createChar() function to define 5-to-8 custom bitmaps, representing different "levels" of a single bar segment (e.g., 20%, 40%, 60% full).
  • Dynamic Mapping Algorithm: The firmware uses the map() function to convert a raw process value (0-100) into a series of full and partial custom characters, creating a smooth, high-resolution visual progress bar.

UI Versatility

  • Flicker-Free Updates: The code optimized the write-cycle; instead of clearing the whole LCD, it only overwrites the specific characters that have changed, ensuring a clean and stable display during fast-moving processes.

ข้อมูล Frontmatter ดั้งเดิม

title: "LcdProgressBar"
description: "LcdProgressBar displays a progress bar in LCD display."
author: "wloche"
category: "Screens & Displays"
tags:
  - "progress bar"
  - "display"
  - "communication"
views: 14043
likes: 2
price: 870
difficulty: "Easy"
components:
  - "1x Arduino UNO"
  - "1x Standard LCD - 16x2 White on Blue"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles:
  - "https://github.com/wloche/LcdProgressBar"
  - "https://github.com/wloche/LcdProgressBar"
documentationLinks: []
passwordHash: "1660213a1194673797e238c1e45a8420777124a830f5d2624b23eb4b0c9d570a"
encryptedPayload: "U2FsdGVkX1/7wdL1pIUC12DdEbtQ6EJMaGJf+sI9QylQ4qRzAs8uykr5Lz7mWRR4ia/yi+M3KzPNUPVVnXo8xga3vzvMeG1cSOPTolBUQMA="
seoDescription: "Display a progress bar on an LCD display using Arduino with the LcdProgressBar project. Easy to implement."
videoLinks:
  - "https://www.youtube.com/embed/3SRARTk7fZY"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/lcdprogressbar-845b29_cover.JPG"
lang: "en"