add cursor

This commit is contained in:
2021-05-21 05:47:23 +02:00
parent d9087580b2
commit 470dd2077c
2 changed files with 10 additions and 0 deletions

9
lcd.c
View File

@@ -9,6 +9,8 @@
volatile unsigned char char_counter = 0;
volatile uint8_t lcd_ctrl_reg = 0;
// output data to lcd
void lcd_out (unsigned char c) {
i2c_start(LCD_I2C_ADDR);
@@ -60,6 +62,13 @@ void lcd_set_position(uint8_t row, uint8_t col){
char_counter = (row * LCD_WIDTH) + col;
}
void lcd_cursor(uint8_t en){
if(en)
lcd_nibble_out(0x08 | 0x04 | 0x02, 0);
else
lcd_nibble_out(0x08 | 0x04, 0);
}
//***************************************************************************************
// clear LCD
void lcd_clear() {