Skip to content

Instantly share code, notes, and snippets.

@giljr
Created January 27, 2024 21:18
Show Gist options
  • Select an option

  • Save giljr/0586c9be40e4ddf118f87f33bd771ffd to your computer and use it in GitHub Desktop.

Select an option

Save giljr/0586c9be40e4ddf118f87f33bd771ffd to your computer and use it in GitHub Desktop.
#include <LCD-I2C.h>
// Default address of most PCF8574 modules, change according
LCD_I2C lcd(0x27, 16, 2);
uint8_t solar[8] = {0b11111,0b10101,0b11111,0b10101,0b11111,0b10101,0b11111,0b00000};
uint8_t battery[8] = {0b01110,0b11011,0b10001,0b10001,0b10001,0b10001,0b10001,0b11111};
uint8_t termometer[8] = {0b00100,0b01010,0b01010,0b01110,0b01110,0b11111,0b11111,0b01110};
uint8_t humidity[8] = {0b00100,0b01010,0b01010,0b01110,0b00100,0b00000,0b00100,0b00000};
uint8_t current[8] = {0b00001,0b00010,0b00100,0b01000,0b11000,0b00110,0b00100,0b01000};
uint8_t charge[8] = {0b01010,0b11111,0b10001,0b10001,0b10001,0b01110,0b00100,0b00100};
uint8_t alarm[8] = {0b00000,0b00100,0b01110,0b01110,0b01110,0b11111,0b00000,0b00100};
uint8_t degree[8] = { 0b00110,0b01001,0b01001,0b00110,0b00000,0b00000,0b00000,000000,};
uint8_t _not[8] = {0b00000,0b10001,0b01010,0b00100,0b01010,0b10001,0b00000,0b00000};
void setup()
{
lcd.begin();
lcd.display();
lcd.backlight();
lcd.createChar(0, solar);
lcd.createChar(1, battery);
lcd.createChar(2, termometer);
lcd.createChar(3, humidity);
lcd.createChar(4, current);
lcd.createChar(5, charge);
lcd.createChar(6, alarm);
lcd.createChar(7, degree);
lcd.write(0);
lcd.write(1);
lcd.write(2);
lcd.write(3);
lcd.write(4);
lcd.write(5);
lcd.write(6);
lcd.write(7);
}
void loop()
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment