//***************************************************************************** // // File Name : 'lcd_lib.c' // Title : 8 and 4 bit LCd interface // Author : Scienceprog.com - Copyright (C) 2007 // Created : 2007-03-29 // Revised : 2007-08-08 // Version : 1.0 // Target MCU : Atmel AVR series // // This code is distributed under the GNU Public License // which can be found at http://www.gnu.org/licenses/gpl.txt // //***************************************************************************** #include "lcd_lib.h" #include #include #include #include const uint8_t LcdCustomChar[] PROGMEM=//define 8 custom LCD chars { 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, // 0. 0/5 full progress block 0x00, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x00, // 1. 1/5 full progress block 0x00, 0x1F, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x00, // 2. 2/5 full progress block 0x00, 0x1F, 0x1C, 0x1C, 0x1C, 0x1C, 0x1F, 0x00, // 3. 3/5 full progress block 0x00, 0x1F, 0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x00, // 4. 4/5 full progress block 0x00, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00, // 5. 5/5 full progress block 0x03, 0x07, 0x0F, 0x1F, 0x0F, 0x07, 0x03, 0x00, // 6. rewind arrow 0x18, 0x1C, 0x1E, 0x1F, 0x1E, 0x1C, 0x18, 0x00 // 7. fast-forward arrow }; void LCDsendChar(uint8_t ch) //Sends Char to LCD { #ifdef LCD_4bit //4 bit part LDP=(ch&0b11110000); LCP|=1< pixelprogress ) { // this is a partial or empty block if( ((i*(uint16_t)PROGRESSPIXELS_PER_CHAR)) > pixelprogress ) { // this is an empty block // use space character? c = 0; } else { // this is a partial block c = pixelprogress % PROGRESSPIXELS_PER_CHAR; } } else { // this is a full block c = 5; } // write character to display LCDsendChar(c); } }