I have tried everything I know and have looked over the Arduino Forum for about 45min now and can not figure out whats wrong. I should press the #1 on the keypad and it should display on an lcd the text but i keep getting error messages with the if statement.
Here is the code:
#include <Key.h>
#include <Keypad.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const byte ROWS = 4;
const byte COLS = 4;
// Key array
char hexaKeys[ROWS][COLS] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
// Connections to Arduino (digital pins on MEGA2560 R3)
byte rowPins[ROWS] = {22, 24, 26, 28};
byte colPins[COLS] = {30, 32, 34, 36
};
// Create keypad object
Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
void setup() {
Serial.begin(9600);
// put your setup code here, to run once:
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// initialize the serial communications:
Serial.begin(9600);
}
void loop() {
if (Keypad = '1');
{
lcd.write("apple watch product#1234567890");
delay(10000000000000000000000000000000);
}
{
else lcd.write("scan Product");
}