Help Understanding Error Messages on Alarm Clock Project

Like many other people, I got an Arduino starter kit for Christmas this year. I love it! And for my first project with it, I decided to try putting together an alarm clock. I’m using some code I found on the Internet for it, which will allow me to use the IR remote that came with the kit, an array of LEDs (honestly not sure of their purpose), and and an active buzzer for the alarm.

The exact modules I’m using are an LCD1602 screen and a DS3231 RTC module. The original code used a DS1302 RTC module, but I think I’ve fixed the code using that module to use mine instead (Feel free to confirm that for me in my code below).

When I try to verify my code, I get this error: no matching function for call to 'LiquidCrystal::LiquidCrystal(int, int). Below I’ll have my code file attached for you to check. Is there something I have written in incorrectly, or anything obvious I missed? Whatever the case, what can I do to fix this error?

For more reference, I’ll include the wiring diagram I got from the code’s original author. The picture shows a temperature sensor which I’m not using, and the DS1302 module plugged directly into the breadboard (where mine is connected with jumper cables directly to the UNO R3 board).

Thank you for taking the time to read my post, and for helping me with this issue.

(Here’s a small excerpt from the beginning lines of my file)

// include the library code
#include <Wire.h> 
#include <LiquidCrystal.h>
#include <DS3231.h>
#include <IRremote.h>
#include <Sleep_n0m1.h> //

// BlueLed1 = 2;
// BlueLed2 = ~9;
// BlueLed3 = 4;
// BlueLed4 = !~3;
// BlueLed5 = 13;
// RedLed1 = 17;
// RedLed2 = 12;
// RedLed3  =16;
// RedLed4 =~10;
// RedLed5  =!~11;
int ledPins[] = { 
  2, 9, 4, 3, 13, 17, 12, 16, 10, 11};       // an array of pin numbers to which LEDs are attached
int pinCount = 10; 
int Ledmodecount = 10;

const int irReceiverPin = 8;  
IRrecv irrecv(irReceiverPin); 
decode_results results; 

#define Buzzer 15
char alarm[4] = {'X','X','X','X'};  

/* DS3231  */
uint8_t CE_PIN   = 5;  //RST pin attach to
uint8_t IO_PIN   = 6;  //
uint8_t SCLK_PIN = 7;
char buf[4];
char day[10];
char Timedate[15];
DS3231 rtc;

Sleep sleep;

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(A4, A5);
int tim = 1000;  //the value of delay time
boolean LCDbacklightOn = false;
boolean LCDDisplayOn = false;

void setup() 
  Serial.begin(9600); //baud  
  // put your setup code here, to run once:
  lcd.begin(16, 2);  //initialize the lcd
  lcd.backlight();  //open the backlight 
  LCDbacklightOn == true;
  LCDDisplayOn == true;

  //IR remote

  //LED Outputs
    for (int thisPin = 0; thisPin < pinCount; thisPin++)  
       //  Serial.println(thisPin);
        pinMode(ledPins[thisPin], OUTPUT);      

   //init lcd info
               lcd.print("Real Time Clock");
               lcd.print("Alarm Lamp");
               lcd.print("By Gavin Lyons");
               lcd.print("Press INFO/MENU");
               lcd.print("for Remote Help");

AlarmClock.ino (20.5 KB)

Here's the reference page for the LiquidCrystal constructor:

LiquidCrystal(rs, enable, d4, d5, d6, d7)
LiquidCrystal(rs, rw, enable, d4, d5, d6, d7)
LiquidCrystal(rs, enable, d0, d1, d2, d3, d4, d5, d6, d7)
LiquidCrystal(rs, rw, enable, d0, d1, d2, d3, d4, d5, d6, d7)

You can see there are several options for the number of parameters, but only passing two parameters is not supported. Your code:

LiquidCrystal lcd(A4, A5);

Attempts to pass only two parameters to the constructor.

The common LCD modules come in two forms. You can get the display module alone, which requires connections of 6 IO pins from your Arduino board, in addition to the power lines, as shown in this tutorial:

That is the type of module the LiquidCrystal library is written for.

You can also get LCD modules which have an I2C driver attached. These allow you to control the module with only the two I2C pins on your Arduino. Since pins A4 and A5 are the I2C pins on many Arduino boards, I suspect you may have one of these LCD modules. You cannot use the LiquidCrystal library with these modules. You need to use a library specifically written for the I2C module. There are several libraries you can use and I don't have a ton of experience to say which is best. This seems to be the community favorite:

You will need to adapt your sketch code to work with that library.

There are a couple of other libraries named LiquidCrystal_I2C, which I believe provide an API more similar to the LiquidCrystal library and are a bit more simple. After spending some time studying the documentation and example sketches of the hd44780 library and experimenting, if you're still stuck, let me know and I can give you a link to one of the LiquidCrystal_I2C libraries. I don't think that will end up being necessary.