More on LCD

This commit is contained in:
Martin Brodbeck 2022-05-30 21:36:56 +02:00
parent 0a48d09436
commit a52c1b94b8
2 changed files with 3 additions and 4 deletions

View File

@ -7,15 +7,14 @@
constexpr uint I2C_SDA_PIN = 26;
constexpr uint I2C_SCL_PIN = 27;
constexpr uint8_t I2C_ADDR = 0x27;
int main() {
// Enable UART so we can print status output
stdio_init_all();
auto myLCD = LCD(i2c1, I2C_SDA_PIN, I2C_SCL_PIN, I2C_ADDR);
auto myLCD = LCD(i2c1, I2C_SDA_PIN, I2C_SCL_PIN);
myLCD.sendString("Hallo, Welt");
myLCD.clear();
myLCD.sendString("le");
myLCD.sendString("Hallo, Wölt!");
}

2
lcd.h
View File

@ -16,7 +16,7 @@ class LCD
{
public:
LCD(i2c_inst_t *i2c, const uint gpio_sda, const uint gpio_scl,
const uint8_t i2c_addr, uint8_t num_cols = 16, uint8_t num_lines = 2);
const uint8_t i2c_addr = 0x27, uint8_t num_cols = 16, uint8_t num_lines = 2);
int backlight_off();
int backlight_on();
void sendString(const std::string &str);