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> //https://github.com/n0m1/Sleep_n0m1
//LEDS
// 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;
//remote
const int irReceiverPin = 8;
IRrecv irrecv(irReceiverPin);
decode_results results;
//Alarm
#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;
//sleepmode
Sleep sleep;
//LCD
// 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;
//clock
rtc.write_protect(false);
rtc.halt(false);
//buzzer
pinMode(Buzzer,OUTPUT);
//IR remote
irrecv.enableIRIn();
//LED Outputs
for (int thisPin = 0; thisPin < pinCount; thisPin++)
{
// Serial.println(thisPin);
pinMode(ledPins[thisPin], OUTPUT);
}
//init lcd info
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Real Time Clock");
lcd.setCursor(0,1);
lcd.print("Alarm Lamp");
delay(1500);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("By Gavin Lyons");
delay(1000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Press INFO/MENU");
lcd.setCursor(0,1);
lcd.print("for Remote Help");
delay(2000);
lcd.clear();
}
AlarmClock.ino (20.5 KB)