Hello guys, I need help.
in this code
char key = Keypad.getKey();
it shows me this error message:
error: expected primary-expression before '.' token
I have been searching for solution for days, but couldn't find it.
I am a newbie into Arduino programming, so if you notice any mistakes please tell me.
Here is the full code:
#include <LiquidCrystal.h>
#include <Keypad.h>
const byte ROWS = 4;
const byte COLS = 4;
char keys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowPins[ROWS] = {5,4,3,2};
byte colPins[COLS] = {9,8,7,6};
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
int sensor1 = 10; // pin za senzor 1
int sensorValue1 = 0;
int mappedValue1;
LiquidCrystal lcd(10, 11, 12, 13, 14, 15, 16);
#define RELAY1 11
void setup(){
lcd.begin(16, 2);
Serial.begin(9600);
}
void loop(){
char key = Keypad.getKey();
lcd.print; key;
sensorValue1 = analogRead(sensor1);
delay(1000);
lcd.print("sensor 1 = " );
lcd.println();
lcd.println(sensorValue1);
lcd.println();
if (sensorValue1 < key)
{
digitalWrite(RELAY1, LOW);
}
if (sensorValue1 > key)
{
digitalWrite(RELAY1, HIGH);
}
}