error with LCD clock sketch

I made a LCD clock. It works, however when I tried to insert serial communication, it gives me the error <Arduino: 1.8.4 (Windows 10), Board: “Arduino/Genuino Uno”

C:\Users\matt\Desktop\arduino\lcd-clock\lcd-clock.ino: In function ‘void loop()’:

lcd-clock:28: error: invalid use of member function (did you forget the ‘()’ ?)

( = serialread);


exit status 1
invalid use of member function (did you forget the ‘()’ ?)

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

This is my code:

<#include <LiquidCrystal.h>

int secs = 00;
int mins = 00;
int hrs = 00;
int buttonless = 10;
int buttonmore = 11;
int buttonselect = 12;

LiquidCrystal lcd(2, 3, 4, 5, 6, 7);

void setup()
lcd.begin(16, 2);


void loop() {
int serialread;
Serial.print(“Specificate if you want to change hrs or mins”);
( = serialread);
if ((serialread) == “hrs”) {
Serial.print(“Insert current hour”);
(hrs = serialread);
if ((serialread) == “mins”) {
Serial.print(“Insert current minute”);
(mins = serialread);

lcd.setCursor(0, 1);
lcd.print(“Have a good day!”);
lcd.setCursor(4, 0);
delay (1000);
(secs = (secs + 1));
if ((secs) == 60) {
(secs = 0);
(mins = (mins + 1));
if ((mins) == 60) {
(mins = 0);
(hrs = (hrs + 1));
if ((mins) == -1) {
(mins = 0);
(hrs = (hrs - 1));
if ((hrs) == 24) {
(hrs = 0);


Thanks to all the people who will try to help me

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn’t show the posting toolbar then you can just manually add the code tags:
[code]``[color=blue]// your code is here[/color]``[/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.

Please always do a Tools > Auto Format on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read. If you’re using the Arduino Web Editor you will not have access to this useful tool. I recommend you to use the standard IDE instead.


lcd-clock:28: error: invalid use of member function (did you forget the '()' ?)

( = serialread);


There are several problems here. The first is explained in the error message. Please consult the reference for the correct syntax:

Next you need to understand the correct use of the assignment operator:


      if ((serialread) == "hrs") {

Please consult the reference link above again to understand what that function is returning and why this part of your code will not work.

thank you