#include <LiquidCrystal.h>
// Pin mapping for the display
const byte LCD_RS = 12;
const byte LCD_E = 13;
const byte LCD_D4 = 5;
const byte LCD_D5 = 4;
const byte LCD_D6 = 3;
const byte LCD_D7 = 2;
// Initialize the LCD object
LiquidCrystal lcd(LCD_RS, LCD_E, LCD_D4, LCD_D5, LCD_D6, LCD_D7);
// Define custom characters for the arrows
uint8_t leftArrow[8] = {
0b00000,
0b00100,
0b01100,
0b11111,
0b01100,
0b00100,
0b00000,
0b00000
};
uint8_t rightArrow[8] = {
0b00000,
0b00100,
0b00110,
0b11111,
0b00110,
0b00100,
0b00000,
0b00000
};
uint8_t straightArrow[8] = {
0b00100,
0b01110,
0b11111,
0b00100,
0b00100,
0b00100,
0b00100,
0b00000
};
void setup() {
// Initialize the LCD with 16 columns and 2 rows
lcd.begin(16, 4);
// Create custom characters
lcd.createChar(0, leftArrow);
lcd.createChar(1, rightArrow);
lcd.createChar(2, straightArrow);
// Display the custom characters
lcd.setCursor(0, 0);
lcd.print("Take diversion left!");
lcd.setCursor(13, 2);
lcd.write(byte(0)); // Display left arrow
//lcd.setCursor(8, 0);
//lcd.print("Right ");
// lcd.setCursor(13, 2);
//lcd.write(byte(1)); // Display right arrow
// lcd.setCursor(0, 1);
//lcd.print("Straight ");
//lcd.setCursor(13, 2);
//lcd.write(byte(2)); // Display straight arrow
}
void loop() {
// Nothing to do here
}