I have a problem in the process of writing code is
//Transfer code from Data_one to LockCode
//Transfer code from Data_one to UnLockCode
// Compare LockCode & UnLock Code (if)
// Match (Unlock)- Send signal to hardware
// Not match (Ignore - Warning)
I don know the command to write a code. Pls help me thx
additional
I 'm trying to do the code on the lock and unlock .
By entering the code number 4 number.
Followed by # and lock
And put it once again
Followed by the * key to unlock.
#include <Keypad.h>
#include <LiquidCrystal.h>
#define Password_Lenght 4 //
LiquidCrystal LCD(A0, A1, A2, A3, A4, A5);
char Data_one[Password_Lenght]; //4 int
byte maxPasswordLength = 4;
byte currentPasswordLength = 0;
byte data_count_one = 0,data_count_two = 0, master_count = 0;
boolean Pass_is_good1 = false;
boolean Pass_is_good2 = false;
boolean Pass_is_good3 = false;
boolean Pass_is_good4 = false;
char customKey_one,customKey_two;
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] = {10, 9, 8, 7};
byte colPins[COLS] = {13, 12, 11};
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup()
{
LCD.begin(16, 2);
}
void lock()
{
}
void unlock()
{
}
void loop()
{
if(customKey_one = keypad.getKey())
{
if(customKey_one != '#')
{
if (customKey_one != '*')
{
//Get password
Data_one[data_count_one] = customKey_one;
LCD.setCursor(data_count_one,0);
LCD.print(Data_one[data_count_one]);
data_count_one++;
}else
//Unlock process
{
if (data_count_one == 4)
{
LCD.clear();
LCD.setCursor(0, 0);
LCD.print("unlock bike");
delay(500);
LCD.clear();
LCD.setCursor(0, 0);
LCD.print(Data_one);
// Transfer code from Data_one to UnLockCode
// Compare LockCode & UnLock Code (if)
// Match (Unlock)- Send signal to hardware
// Not match (Ignore - Warning)
data_count_one==0; //reset counter
}else
{
LCD.clear();
LCD.setCursor(0, 0);
LCD.print("num only");
delay(500);
LCD.clear();
LCD.setCursor(0, 0);
LCD.print(Data_one);
}
}
}else
//Lock process
{ if (data_count_one == 4)
//Lock
{
LCD.clear();
LCD.setCursor(0, 0);
LCD.print("lock bike");
delay(500);
LCD.clear();
LCD.setCursor(0, 0);
LCD.print(Data_one);
// Transfer code from Data_one to LockCode
// Send signal to hardware
data_count_one==0; //reset counter
}else
{
LCD.clear();
LCD.setCursor(0, 0);
LCD.print("Number only");
delay(500);
LCD.clear();
LCD.setCursor(0, 0);
LCD.print(Data_one);
}
}
}//if customeKey_one
}//end loop