Hello!
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 ‘()’ ?)
(Serial.read = 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()
{
Serial.begin(9600);
lcd.begin(16, 2);
lcd.clear();
}
void loop() {
int serialread;
{
while(Serial.available())
{
Serial.print(“Specificate if you want to change hrs or mins”);
(Serial.read = serialread);
if ((serialread) == “hrs”) {
Serial.print(“Insert current hour”);
(hrs = serialread);
}
if ((serialread) == “mins”) {
Serial.print(“Insert current minute”);
(mins = serialread);
}
}
}
lcd.clear();
lcd.setCursor(0, 1);
lcd.print(“Have a good day!”);
lcd.setCursor(4, 0);
lcd.print(hrs);
lcd.print(":");
lcd.print(mins);
lcd.print(":");
lcd.print(secs);
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