//#include <Stepper.h>
#include <AccelStepper.h>
#include <Keypad.h>
#include <EEPROM.h>
// #include <LiquidCrystal.h>
#include <LiquidCrystal_I2C.h>
// Alamat EEPROM untuk penyimpanan
const int StepMotorXAddr = 0;
const int StepMotorYAddr = sizeof(int);
const int MaxStepXAddr = 2 * sizeof(int);
const int MaxCountStepYAddr = 3 * sizeof(int);
// // Inisialisasi keypad
// const byte ROWS = 4;
// const byte COLS = 3;
// char keys[ROWS][COLS] = {
// {'1','2','3'},
// {'4','5','6'},
// {'7','8','9'},
// {'*','0','#'}
// };
// byte rowPins[ROWS] = {PIN_PD0, PIN_PD1, PIN_PD2, PIN_PD3}; // Hubungkan baris keypad ke pin Arduino
// byte colPins[COLS] = {PIN_PC5, PIN_PC4, PIN_PC3}; // Hubungkan kolom keypad ke pin Arduino
// Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
// Define the keymap and keypad connections
const byte ROWS = 4; // four rows
const byte COLS = 3; // four columns
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
byte rowPins[ROWS] = {12, 11, 10, A3};
byte colPins[COLS] = {A2, A1, A0};
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
bool Running = false;
// Parameter Data Inputan
int StepMotorX = 0;
int StepMotorY = 0;
int MaxStepX = 0;
int MaxCountStepY = 0;
// Parameter Process Counting
int GotoStep = 0;
int CountStep = 0;
int CountSensor = 0;
int GobackStep = 0;
int Direction = 0;
// Parameter Display LCD
int x = 0;
// // Inisialisasi LCD
// const int RS = PIN_PB0, EN = PIN_PB1, D4 = PIN_PB2, D5 = PIN_PB3, D6 = PIN_PB4, D7 = PIN_PB5;
// LiquidCrystal lcd(RS, EN, D4, D5, D6, D7);
// Define the connections for the LCD
LiquidCrystal_I2C lcd(0x27,20, 4);
// // Output
// const int Buzzer = PIN_PC0;
// //const int Motor_DC = PIN_PD4;
// Output
const int Buzzer = 13;
// // Input
// const int Sensor = PIN_PC2;
// // Inisialisasi Motor Stepper
// const int StepPin1 = PIN_PD6; // Pin 1 motor stepper 1 (STEP)
// const int DirPin1 = PIN_PD5; // Pin 2 motor stepper 1 (DIR)
// const int EnaPin1 = PIN_PD7; // Pin 3 motor stepper 1 (EN)
// Inisialisasi Motor Stepper 1
const int StepPin1 = 4; // Pin 1 motor stepper 1 (STEP)
const int DirPin1 = 5; // Pin 2 motor stepper 1 (DIR)
const int EnaPin1 = 6; // Pin 3 motor stepper 1 (EN)
// Inisialisasi Motor Stepper 1
const int StepPin2 = 7; // Pin 1 motor stepper 2 (STEP)
const int DirPin2 = 8; // Pin 2 motor stepper 2 (DIR)
const int EnaPin2 = 9; // Pin 3 motor stepper 2 (EN)
// Inisialisasi objek stepper
//Stepper myStepper(EnaPin, StepPin, DirPin);
AccelStepper myStepper1(1, StepPin1, DirPin1); // pin 2 dan 3 untuk step dan direction
AccelStepper myStepper2(1, StepPin2, DirPin2); // pin 2 dan 3 untuk step dan direction
// the 8 arrays that form each segment of the custom numbers
byte LT[8] =
{
B00111,
B01111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111
};
byte UB[8] =
{
B11111,
B11111,
B11111,
B00000,
B00000,
B00000,
B00000,
B00000
};
byte RT[8] =
{
B11100,
B11110,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111
};
byte LL[8] =
{
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B01111,
B00111
};
byte LB[8] =
{
B00000,
B00000,
B00000,
B00000,
B00000,
B11111,
B11111,
B11111
};
byte LR[8] =
{
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11110,
B11100
};
byte UMB[8] =
{
B11111,
B11111,
B11111,
B00000,
B00000,
B00000,
B11111,
B11111
};
byte LMB[8] =
{
B11111,
B00000,
B00000,
B00000,
B00000,
B11111,
B11111,
B11111
};
void setup() {
// put your setup code here, to run once:
// Set pin-ping sebagai output
pinMode(EnaPin1, OUTPUT);
pinMode(DirPin1, OUTPUT);
pinMode(StepPin1, OUTPUT);
pinMode(EnaPin2, OUTPUT);
pinMode(DirPin2, OUTPUT);
pinMode(StepPin2, OUTPUT);
pinMode(Buzzer, OUTPUT);
// pinMode(Motor_DC, OUTPUT);
// pinMode(Sensor, INPUT);
// Aktifkan driver motor
digitalWrite(EnaPin1, HIGH);
digitalWrite(EnaPin2, HIGH);
// // Start LCD Display
// lcd.begin(20, 4); // initialize the lcd
// Start LCD Display
lcd.init();
lcd.backlight();
// assignes each segment a write number
lcd.createChar(8,LT);
lcd.createChar(1,UB);
lcd.createChar(2,RT);
lcd.createChar(3,LL);
lcd.createChar(4,LB);
lcd.createChar(5,LR);
lcd.createChar(6,UMB);
lcd.createChar(7,LMB);
EEPROM.get(StepMotorXAddr, StepMotorX);
delay(10);
EEPROM.get(StepMotorYAddr, StepMotorY);
delay(10);
EEPROM.get(MaxStepXAddr, MaxStepX);
delay(10);
EEPROM.get(MaxCountStepYAddr, MaxCountStepY);
delay(10);
lcd.setCursor(4,1);
lcd.print("COIL WINDING");
lcd.setCursor(6,2);
lcd.print("MACHINE!");
delay(500);
lcd.clear();
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
delay(10);
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
delay(10);
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
myStepper1.setMaxSpeed(1000); // Set kecepatan maksimum motor stepper
myStepper1.setAcceleration(500); // Set akselerasi motor stepper
myStepper2.setMaxSpeed(1000); // Set kecepatan maksimum motor stepper
myStepper2.setAcceleration(500); // Set akselerasi motor stepper
// // Set stepper motors step counter to zero
// myStepper1.setCurrentPosition(0);
// myStepper2.setCurrentPosition(0);
x = 0;
letters1();
x = 8;
letters2();
delay (1000);
lcd.clear();
DisplayAwal();
if (MaxStepX > 0) {
lcd.setCursor(6,1);
lcd.print(StepMotorY);
// lcd.setCursor(6,1);
// lcd.print(CountStep);
lcd.setCursor(15,1);
lcd.print(StepMotorX);
lcd.setCursor(6,2);
lcd.print(GotoStep);
lcd.setCursor(15,2);
lcd.print(MaxStepX);
lcd.setCursor(6,3);
lcd.print(CountSensor);
lcd.setCursor(15,3);
lcd.print(MaxCountStepY);
} else {
// Get inputs from user
lcd.setCursor(15,1);
StepMotorX = getStepMotorX();
EEPROM.put(StepMotorXAddr, StepMotorX);
delay(10);
lcd.setCursor(6,1);
StepMotorY = getStepMotorY();
EEPROM.put(StepMotorYAddr, StepMotorY);
delay(10);
lcd.setCursor(15,2);
MaxStepX = getMaxStepX();
EEPROM.put(MaxStepXAddr, MaxStepX);
delay(10);
lcd.setCursor(15,1);
lcd.print(StepMotorX);
lcd.setCursor(6,1);
lcd.print(StepMotorY);
lcd.setCursor(15,2);
lcd.print(MaxStepX);
lcd.setCursor(15,3);
MaxCountStepY = getMaxCountStepY();
EEPROM.put(MaxCountStepYAddr, MaxCountStepY);
delay(10);
lcd.setCursor(15,0);
lcd.print(" ");
lcd.setCursor(15,0);
lcd.print("READY");
}
}
void loop() {
// put your main code here, to run repeatedly:
char Key = keypad.getKey();
if (Key == '#') {
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
GotoStep = 0;
GobackStep = 0;
CountStep = 0;
CountSensor = 0;
Running = true;
DisplayRUN();
}
if (Key == '*') {
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
resetMachine();
}
if (Running) {
// digitalWrite(Motor_DC, HIGH);
digitalWrite(EnaPin1, LOW);
digitalWrite(EnaPin2, LOW);
// digitalWrite(DirPin2, HIGH); // Set direction
myStepper2.moveTo(StepMotorY); // Tentukan jumlah langkah yang diinginkan, misalnya 800
myStepper2.runToPosition(); // Menjalankan motor stepper ke posisi yang ditentukan
// int SensorState = digitalRead(Sensor);
int SensorState = StepMotorY;
if (SensorState == StepMotorY) {
CountSensor++;
lcd.setCursor(6,3);
lcd.print(" ");
lcd.setCursor(6,3);
lcd.print(CountSensor);
// Cek apakah counter mencapai Maksimal Limit CountSensor
if (CountSensor < MaxCountStepY) {
// Cek apakah counter mencapai Maksimal Limit CountSensor
if (GotoStep < MaxStepX) {
Direction = 1;
if ((MaxStepX-GotoStep) >= StepMotorX) {
// digitalWrite(EnaPin1, LOW);
// Rotate the motor in one direction
// digitalWrite(DirPin1, HIGH); // Set direction
// StepperMotor(StepMotor); // Perform steps
myStepper1.moveTo(StepMotorX); // Tentukan jumlah langkah yang diinginkan, misalnya 800
myStepper1.runToPosition(); // Menjalankan motor stepper ke posisi yang ditentukan
// delay(1000); // Wait for a second
GotoStep += StepMotorX;
// digitalWrite(EnaPin1, HIGH);
}
else if ((MaxStepX-GotoStep) < StepMotorX) {
// digitalWrite(EnaPin1, LOW);
// Rotate the motor in one direction
// digitalWrite(DirPin1, HIGH); // Set direction
// StepperMotor(MaxStep-GotoStep); // Perform steps
myStepper1.moveTo(MaxStepX-GotoStep); // Tentukan jumlah langkah yang diinginkan, misalnya 800
myStepper1.runToPosition(); // Menjalankan motor stepper ke posisi yang ditentukan
// delay(1000); // Wait for a second
GotoStep += (MaxStepX-GotoStep);
// digitalWrite(EnaPin1, HIGH);
}
if (GotoStep == MaxStepX) {
GobackStep = 0;
}
lcd.setCursor(6,1);
lcd.print(" ");
lcd.setCursor(6,1);
lcd.print("RIGHT");
lcd.setCursor(6,2);
lcd.print(" ");
lcd.setCursor(6,2);
lcd.print(GotoStep);
}
else if (GotoStep >= MaxStepX) {
Direction = 0;
if ((MaxStepX-GobackStep) >= StepMotorX) {
// digitalWrite(EnaPin1, LOW);
// Rotate the motor in one direction
// digitalWrite(DirPin1, LOW); // Set direction
// StepperMotor(StepMotor); // Perform steps
myStepper1.moveTo(-StepMotorX); // Tentukan jumlah langkah yang diinginkan, misalnya 800
myStepper1.runToPosition(); // Menjalankan motor stepper ke posisi yang ditentukan
// delay(1000); // Wait for a second
GobackStep += StepMotorX;
// digitalWrite(EnaPin1, HIGH);
}
else if ((MaxStepX-GobackStep) < StepMotorX) {
// digitalWrite(EnaPin1, LOW);
// Rotate the motor in one direction
// digitalWrite(DirPin1, LOW); // Set direction
// StepperMotor(MaxStep-GobackStep); // Perform steps
myStepper1.moveTo(-(MaxStepX-GobackStep)); // Tentukan jumlah langkah yang diinginkan, misalnya 800
myStepper1.runToPosition(); // Menjalankan motor stepper ke posisi yang ditentukan
// delay(1000); // Wait for a second
GobackStep += (MaxStepX-GobackStep);
// digitalWrite(EnaPin1, HIGH);
}
if (GobackStep == MaxStepX) {
GotoStep = 0;
}
lcd.setCursor(6,1);
lcd.print(" ");
lcd.setCursor(6,1);
lcd.print("LEFT");
lcd.setCursor(6,2);
lcd.print(" ");
lcd.setCursor(6,2);
lcd.print(GobackStep);
}
// lcd.setCursor(6,1);
// lcd.print(" ");
// lcd.setCursor(6,1);
// lcd.print(CountStep);
}
else if (CountSensor >= MaxCountStepY) {
// digitalWrite(Motor_DC, LOW);
// digitalWrite(EnaPin2, LOW);
digitalWrite(EnaPin2, HIGH);
delay (2000);
if (Direction > 0) {
lcd.setCursor(6,1);
lcd.print(" ");
lcd.setCursor(6,1);
lcd.print("BACK");
lcd.setCursor(6,2);
lcd.print(" ");
lcd.setCursor(6,2);
lcd.print(GotoStep);
// digitalWrite(EnaPin1, LOW);
// Rotate the motor in one direction
// digitalWrite(DirPin1, LOW); // Set direction
// StepperMotor(GotoStep); // Perform steps
myStepper1.moveTo(GotoStep); // Tentukan jumlah langkah yang diinginkan, misalnya 800
myStepper1.runToPosition(); // Menjalankan motor stepper ke posisi yang ditentukan
// digitalWrite(EnaPin1, LOW);
digitalWrite(EnaPin1, HIGH);
delay(1000);
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
delay(10);
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
delay(10);
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
lcd.setCursor(6,0);
lcd.print(" ");
lcd.setCursor(6,0);
lcd.print("STOP");
lcd.setCursor(15,0);
lcd.print(" ");
lcd.setCursor(15,0);
lcd.print("DONE");
// Running = false;
} else {
// GobackStep += CountStep;
lcd.setCursor(6,1);
lcd.print(" ");
lcd.setCursor(6,1);
lcd.print("BACK");
lcd.setCursor(6,2);
lcd.print(" ");
lcd.setCursor(6,2);
lcd.print(GobackStep);
// digitalWrite(EnaPin, LOW);
// Rotate the motor in one direction
// digitalWrite(DirPin, LOW); // Set direction
// StepperMotor(MaxStep-GobackStep); // Perform steps
myStepper1.moveTo(MaxStepX-GobackStep); // Tentukan jumlah langkah yang diinginkan, misalnya 800
myStepper1.runToPosition(); // Menjalankan motor stepper ke posisi yang ditentukan
// digitalWrite(EnaPin, LOW);
digitalWrite(EnaPin1, HIGH);
delay(1000);
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
delay(10);
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
delay(10);
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
lcd.setCursor(6,0);
lcd.print(" ");
lcd.setCursor(6,0);
lcd.print("STOP");
lcd.setCursor(15,0);
lcd.print(" ");
lcd.setCursor(15,0);
lcd.print("DONE");
// Running = false;
}
Running = false;
}
// while(digitalRead(Sensor) == HIGH);
// delay(10); // Debounce sensor
}
}
}
void DisplayAwal() {
lcd.setCursor(6,0);
lcd.print("MODE");
lcd.setCursor(15,0);
lcd.print("INPUT");
lcd.setCursor(0,1);
lcd.print("STEP: ");
lcd.setCursor(6,1);
lcd.print(StepMotorY);
// lcd.setCursor(6,1);
// lcd.print(CountStep);
lcd.setCursor(12,1);
lcd.print("|| ");
lcd.setCursor(15,1);
lcd.print(StepMotorX);
lcd.setCursor(0,2);
lcd.print("SIZE: ");
lcd.setCursor(6,2);
lcd.print(GotoStep);
lcd.setCursor(12,2);
lcd.print("|| ");
lcd.setCursor(15,2);
lcd.print(MaxStepX);
lcd.setCursor(0,3);
lcd.print("TURN: ");
lcd.setCursor(6,3);
lcd.print(CountSensor);
lcd.setCursor(12,3);
lcd.print("|| ");
lcd.setCursor(15,3);
lcd.print(MaxCountStepY);
}
void DisplayRUN() {
lcd.setCursor(6,0);
lcd.print(" ");
lcd.setCursor(6,0);
lcd.print("RUN");
lcd.setCursor(15,0);
lcd.print(" ");
lcd.setCursor(15,0);
lcd.print("MOTOR");
lcd.setCursor(6,1);
lcd.print(" ");
lcd.setCursor(6,1);
lcd.print(StepMotorY);
// lcd.setCursor(6,1);
// lcd.print(CountStep);
lcd.setCursor(6,2);
lcd.print(" ");
lcd.setCursor(6,2);
lcd.print(GotoStep);
lcd.setCursor(6,3);
lcd.print(" ");
lcd.setCursor(6,3);
lcd.print(CountSensor);
}
// Function to get integer input from keypad
int getStepMotorX() {
StepMotorX = 0;
char Key;
int CursorPosition = 15; // Manually track the cursor position
lcd.setCursor(15, 1); // Set cursor to second line
lcd.blink();
do {
Key = keypad.getKey();
if (Key >= '0' && Key <= '9') {
StepMotorX = StepMotorX * 10 + (Key - '0');
lcd.print(Key);
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
CursorPosition++;
} else if (Key == '*' && CursorPosition > 15) {
lcd.setCursor(CursorPosition - 1, 1);
lcd.print(" "); // Overwrite the last digit with a space
lcd.setCursor(CursorPosition - 1, 1);
StepMotorX /= 10; // Remove the last digit
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
CursorPosition--;
}
} while (Key != '#');
lcd.noBlink();
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
return StepMotorX;
}
// Function to get integer input from keypad
int getStepMotorY() {
StepMotorY = 0;
char Key;
int CursorPosition = 6; // Manually track the cursor position
lcd.setCursor(6, 1); // Set cursor to second line
lcd.blink();
do {
Key = keypad.getKey();
if (Key >= '0' && Key <= '9') {
StepMotorY = StepMotorY * 10 + (Key - '0');
lcd.print(Key);
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
CursorPosition++;
} else if (Key == '*' && CursorPosition > 6) {
lcd.setCursor(CursorPosition - 1, 1);
lcd.print(" "); // Overwrite the last digit with a space
lcd.setCursor(CursorPosition - 1, 1);
StepMotorY /= 10; // Remove the last digit
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
CursorPosition--;
}
} while (Key != '#');
lcd.noBlink();
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
return StepMotorY;
}
// Function to get integer input from keypad
int getMaxStepX() {
MaxStepX = 0;
char Key;
int CursorPosition = 15; // Manually track the cursor position
lcd.setCursor(15, 2); // Set cursor to second line
lcd.blink();
do {
Key = keypad.getKey();
if (Key >= '0' && Key <= '9') {
MaxStepX = MaxStepX * 10 + (Key - '0');
lcd.print(Key);
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
CursorPosition++;
} else if (Key == '*' && CursorPosition > 15) {
lcd.setCursor(CursorPosition - 1, 2);
lcd.print(" "); // Overwrite the last digit with a space
lcd.setCursor(CursorPosition - 1, 2);
MaxStepX /= 10; // Remove the last digit
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
CursorPosition--;
}
} while (Key != '#');
lcd.noBlink();
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
return MaxStepX;
}
// Function to get integer input from keypad
int getMaxCountStepY() {
MaxCountStepY = 0;
char Key;
int CursorPosition = 15; // Manually track the cursor position
lcd.setCursor(15, 3); // Set cursor to second line
lcd.blink();
do {
Key = keypad.getKey();
if (Key >= '0' && Key <= '9') {
MaxCountStepY = MaxCountStepY * 10 + (Key - '0');
lcd.print(Key);
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
CursorPosition++;
} else if (Key == '*' && CursorPosition > 15) {
lcd.setCursor(CursorPosition - 1, 3);
lcd.print(" "); // Overwrite the last digit with a space
lcd.setCursor(CursorPosition - 1, 3);
MaxCountStepY /= 10; // Remove the last digit
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
CursorPosition--;
}
} while (Key != '#');
lcd.noBlink();
digitalWrite(Buzzer, HIGH);
delay(100);
digitalWrite(Buzzer, LOW);
return MaxCountStepY;
}
// Functions to reset the machine
void(* resetFunc) (void) = 0; // create a standard reset function
void resetMachine() {
Running = false;
lcd.clear();
EEPROM.put(StepMotorXAddr, 0);
delay(10);
EEPROM.put(StepMotorYAddr, 0);
delay(10);
EEPROM.put(MaxStepXAddr, 0);
delay(10);
EEPROM.put(MaxCountStepYAddr, 0);
delay(10);
lcd.setCursor(2, 1);
lcd.print(" RESETTING... ");
delay(1000);
lcd.clear();
resetFunc(); // reset the Arduino via Software
}
//// Function to perform a given number of steps
//void StepperMotor(int Steps) {
// for (int i = 0; i < Steps; i++) {
// digitalWrite(StepPin, HIGH);
// delayMicroseconds(400); // Adjust delay to control speed
// digitalWrite(StepPin, LOW);
// delayMicroseconds(400); // Adjust delay to control speed
// CountStep = i+1;
// }
//}
void customD()
{
lcd.setCursor(x, 0);
lcd.write(255);
lcd.write(1);
lcd.write(2);
lcd.setCursor(x, 1);
lcd.write(255);
lcd.write(4);
lcd.write(5);
}
void customE()
{
lcd.setCursor(x,0);
lcd.write(255);
lcd.write(6);
lcd.write(6);
lcd.setCursor(x, 1);
lcd.write(255);
lcd.write(7);
lcd.write(7);
}
void customP()
{
lcd.setCursor(x,0);
lcd.write(255);
lcd.write(6);
lcd.write(2);
lcd.setCursor(x,1);
lcd.write(255);
}
void custom0O()
{ // uses segments to build the number 0
lcd.setCursor(x,0);
lcd.write(8);
lcd.write(1);
lcd.write(2);
lcd.setCursor(x,1);
lcd.write(3);
lcd.write(4);
lcd.write(5);
}
void customT()
{
lcd.setCursor(x,2);
lcd.write(1);
lcd.write(255);
lcd.write(1);
lcd.setCursor(x,3);
lcd.write(254);
lcd.write(255);
}
void customE1()
{
lcd.setCursor(x,2);
lcd.write(255);
lcd.write(6);
lcd.write(6);
lcd.setCursor(x,3);
lcd.write(255);
lcd.write(7);
lcd.write(7);
}
void customC()
{
lcd.setCursor(x,2);
lcd.write(8);
lcd.write(1);
lcd.write(1);
lcd.setCursor(x,3);
lcd.write(3);
lcd.write(4);
lcd.write(4);
}
void customH()
{
lcd.setCursor(x,2);
lcd.write(255);
lcd.write(4);
lcd.write(255);
lcd.setCursor(x, 3);
lcd.write(255);
lcd.write(254);
lcd.write(255);
}
void letters1()
{
customD();
x = x + 3;
customE();
x = x + 3;
customP();
x = x + 3;
custom0O();
// delay(500);
}
void letters2()
{
customT();
x = x + 3;
customE1();
x = x + 3;
customC();
x = x + 3;
customH();
// delay(500);
}