![]() |
Zap'Em Blast'Em Robots
robots that play laser tag!
|
LCD driver for 20x4 I2C display. Adapted from SunFounder example. More...
#include "lcd.h"
Macros | |
#define | LCD_BACKLIGHT 0x08 |
#define | LCD_ENABLE 0x04 |
#define | LCD_RW 0x00 |
#define | LCD_RS 0x01 |
Functions | |
void | lcd_send_command (uint8_t cmd) |
Sends a command byte to the LCD. | |
void | lcd_send_data (uint8_t data) |
Sends a data byte (character) to the LCD. | |
void | lcd_force_backlight_on (void) |
Forces the LCD backlight to turn on. | |
void | lcd_init (void) |
Initializes the LCD in 4-bit mode. | |
void | lcd_clear (void) |
Clears the LCD display. | |
void | lcd_set_cursor (uint8_t row, uint8_t col) |
Sets the LCD cursor to the specified position. | |
void | lcd_print (char *str) |
Prints a string to the LCD display. |
LCD driver for 20x4 I2C display. Adapted from SunFounder example.
void lcd_force_backlight_on | ( | void | ) |
Forces the LCD backlight to turn on.
Forces the LCD backlight to remain on.
void lcd_init | ( | void | ) |
Initializes the LCD in 4-bit mode.
Initializes the LCD in 4-bit I2C mode.
void lcd_print | ( | char * | str | ) |
Prints a string to the LCD display.
Prints a null-terminated string to the LCD.
str | Null-terminated character string |
void lcd_send_command | ( | uint8_t | cmd | ) |
Sends a command byte to the LCD.
cmd | Command byte |
void lcd_send_data | ( | uint8_t | data | ) |
Sends a data byte (character) to the LCD.
data | Data byte |
void lcd_set_cursor | ( | uint8_t | row, |
uint8_t | col ) |
Sets the LCD cursor to the specified position.
Sets the LCD cursor to a specific row and column.
row | Row index (0–3) |
col | Column index (0–19) |