primary expression error

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); 
}
}

I think this line
lcd.print; key;
needs some ( ), perhaps:
lcd.print (key);

  char key = Keypad.getKey();

Your instance name is NOT Keypad.

That was it!
I just changed Keypad.getKey into keypad.getKey and it worked.
Thanks guys!

Hello Everyone!

I am new with Arduino as well and I need to know what in the world is wrong with my code.

#include <Servo.h>

int servoPin = 10;
int seroPin = 9;
int servoPin = 6;
int servoPin = 3;
int servoPin = 5;

Servo servo;
Servo servo1;
Servo servo2;
Servo servo3;
Servo servo4;
Servo servo5;

int angle = 0;

void setup() {
// put your setup code here, to run once:
servo1.attach(10);
servo2.attach(9);
servo3.attach(6);
servo4.attach(3);
servo5.attach(5);
}

void loop() {
// put your main code here, to run repeatedly:
for(angle = 0; angle < 90; angle ++ 1;)
{
servo1.write(90);
servo2.write(90);
servo3.write(90);
servo4.write(90);
servo5.write(90);
}
}

It is giving me many different code errors...I really need your help.
Thanks

@gummy781
Do not ask your questions in other people's thread, start your own.

What's not working?
How are the servos wired?
What happens after the last } in loop() ?
How fast does loop() run ?

angle ++ 1; humm
.

Ok I am sorry, but I don't know how to do that.

a)absolutely nothing is working
b) the ground wires go to the Arduino and the other two wires go to the breadboard
c) I don't understand
d)what do you mean
e) is it =+ and what do they mean?

b) the ground wires go to the Arduino and the other two wires go to the breadboard

Draw a picture of all the wires. Post it.

for(angle = 0; angle < 90; angle ++ 1;)
{
servo1.write(90);
servo2.write(90);
servo3.write(90);
servo4.write(90);
servo5.write(90);
}

What is the point of looping when you do exactly the same thing on every iteration of the loop? Your for loop looks strange. The last term should be angle += 1 or angle++.

c) I don't understand

You need to learn what loop() does, then.

e) is it =+ and what do they mean?

No, its += and it is a compound operator (look them up).

@gummy781 I Founded The Problem. Underlined Text Is The Problem. :

void loop() {
// put your main code here, to run repeatedly:
for(angle = 0; angle <= 90; angle += 1;)
{
servo1.write(90);
servo2.write(90);
servo3.write(90);
servo4.write(90);
servo5.write(90);
}
}

qwertfksonjsidjijsudfh:
well your better than me had the same error message

But I bet the code you didn't post is different.