// simple project using Arduino UNO and 16x2 character display to display smooth gauge,
// created by upir, 2022
// youtube channel: https://www.youtube.com/upir_upir
// FULL TUTORIAL: https://youtu.be/ZzIGHiHObYw
// GAUGE IN 11 MINUTES TUTORIAL: https://youtu.be/upE17NHrdPc
// Links related to this project:
// Arduino UNO - https://s.click.aliexpress.com/e/_AXDw1h
// Arduino breadboard prototyping shield - https://s.click.aliexpress.com/e/_ApbCwx
// 16x2 displays with IIC - https://s.click.aliexpress.com/e/_9Hl3JV
// 16x2 display with RGB backlight - https://s.click.aliexpress.com/e/_9wgpeb
// original sketch from YWROBOT - https://wokwi.com/arduino/libraries/LiquidCrystal_I2C/HelloWorld
// character creator - https://tusindfryd.github.io/screenduino/
// another character creator - https://maxpromer.github.io/LCD-Character-Creator/
// sprintf explanation - https://www.programmingelectronics.com/sprintf-arduino/
// custom characters simplest project - https://wokwi.com/projects/294395602645549578
// Arduino I2C scanner - https://playground.arduino.cc/Main/I2cScanner/
// 16x2 available characters - https://docs.wokwi.com/parts/wokwi-lcd1602#font
// Bitwise Operators in GIFs - https://blog.wokwi.com/bitwise-operators-in-gifs/
// Bitwise operators Arduino documentation - https://www.arduino.cc/reference/en/language/structure/bitwise-operators/bitshiftleft/
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,20,4); //set the LCD address to 0x27 for a 16-char & 2-line display
byte customChar8[8] = {
0b00001,
0b11111,
0b00001,
0b00001,
0b11111,
0b10011,
0b11011,
0b11011
};//ส
byte customChar9[8] = {0b00000,
0b11001,
0b11001,
0b01001,
0b01001,
0b01001,
0b01001,
0b01111
};//บ
byte customChar10[8] = {
0b00000,
0b11010,
0b11010,
0b10010,
0b11010,
0b10010,
0b10010,
0b11110
}; //ม
byte customChar11[8] = {
0b00000,
0b11010,
0b11010,
0b10010,
0b11010,
0b10010,
0b10010,
0b11110
};//บ
byte customChar13[8] = {
0b00000,
0b11111,
0b10001,
0b00001,
0b00001,
0b00001,
0b00001,
0b00001
};//า
byte customChar[8] = {
0b00000,
0b00000,
0b00000,
0b10010,
0b10010,
0b11010,
0b10010,
0b11110
};//ย
byte customChar14[8] = {
0b00000,
0b11001,
0b11001,
0b01001,
0b01001,
0b01001,
0b11111,
0b11001
};//ส์
byte customChar15[8] = {
0b11111,
0b10001,
0b00001,
0b00001,
0b00001,
0b00001,
0b00001
};//ด
byte customChar12[8] = {
0b00000,
0b01110,
0b10001,
0b01001,
0b10001,
0b10001,
0b10001,
0b10001
}; //ส
byte customChar1[8] = {
0b10000,
0b11110,
0b00000,
0b11100,
0b00100,
0b00100,
0b00100,
0b01100
}; //วั
byte customChar2[8] = {
0b00000,
0b11001,
0b11001,
0b01001,
0b01001,
0b11111,
0b11001,
0b11001
}; //ดี
byte customChar3[8] = {
0b00000,
0b00000,
0b00000,
0b10100,
0b10100,
0b10100,
0b11110,
0b10100
}; //น
byte customChar4[8] = {
0b00000,
0b00000,
0b00000,
0b00000,
0b11100,
0b00000,
0b11100,
0b00000
};// ะ
byte customChar6[8] = {
0b10000,
0b11110,
0b00000,
0b11110,
0b10000,
0b11100,
0b00100,
0b01100
}; //รั
void setup()
{
lcd.init();
lcd.backlight();
lcd.createChar(0, customChar8); //ส
lcd.createChar(1, customChar9); //บ
lcd.createChar(2, customChar10); //า
lcd.createChar(3, customChar11); //ย
lcd.createChar(4, customChar14); //ม
lcd.createChar(5, customChar12); //า
lcd.createChar(6, customChar12); //ก
lcd.createChar(7, customChar15); //ด
lcd.setCursor(3,1);
lcd.write((uint8_t)0);
lcd.write((uint8_t)1);
lcd.write((uint8_t)7);
lcd.write((uint8_t)3);
lcd.write((uint8_t)4);
lcd.write((uint8_t)7);
lcd.write((uint8_t)6);
}
void loop()
{scrollTextDisplay();
}
void scrollTextDisplay(){
}