further adjustments for 4*20 lcd
This commit is contained in:
18
lcd.c
18
lcd.c
@@ -102,11 +102,10 @@ void lcd_init() {
|
|||||||
|
|
||||||
//***************************************************************************************
|
//***************************************************************************************
|
||||||
void lcd_write_char (char c) {
|
void lcd_write_char (char c) {
|
||||||
if(char_counter == LCD_WIDTH) lcd_nibble_out(LCD_ADDR_LINE2,0);
|
if(char_counter == LCD_WIDTH) lcd_set_position(1,0);
|
||||||
if(char_counter == (LCD_WIDTH*2)){
|
if(char_counter == 2*LCD_WIDTH) lcd_set_position(2,0);
|
||||||
lcd_nibble_out(LCD_ADDR_LINE1,0);
|
if(char_counter == 3*LCD_WIDTH) lcd_set_position(3,0);
|
||||||
char_counter = 0;
|
if(char_counter == 4*LCD_WIDTH) lcd_set_position(0,0);
|
||||||
}
|
|
||||||
char_counter++;
|
char_counter++;
|
||||||
lcd_nibble_out(c, 1);
|
lcd_nibble_out(c, 1);
|
||||||
}
|
}
|
||||||
@@ -114,11 +113,10 @@ void lcd_write_char (char c) {
|
|||||||
//***************************************************************************************
|
//***************************************************************************************
|
||||||
void lcd_print_str(char *str) {
|
void lcd_print_str(char *str) {
|
||||||
while (*str != 0){
|
while (*str != 0){
|
||||||
if(char_counter == LCD_WIDTH) lcd_nibble_out(LCD_ADDR_LINE2,0);
|
if(char_counter == LCD_WIDTH) lcd_set_position(1,0);
|
||||||
if(char_counter == (LCD_WIDTH*2)){
|
if(char_counter == 2*LCD_WIDTH) lcd_set_position(2,0);
|
||||||
lcd_nibble_out(LCD_ADDR_LINE1,0);
|
if(char_counter == 3*LCD_WIDTH) lcd_set_position(3,0);
|
||||||
char_counter = 0;
|
if(char_counter == 4*LCD_WIDTH) lcd_set_position(0,0);
|
||||||
}
|
|
||||||
char_counter++;
|
char_counter++;
|
||||||
lcd_nibble_out(*str++, 1);
|
lcd_nibble_out(*str++, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user