#include <LiquidCrystal.h>
int h=14,m=46,s=0;
int alarmH = 14, alarmMin = 46, alarmSec = 15;
LiquidCrystal My_LCD(13, 12, 14, 27, 26, 25);
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
const int buzzer = 33;
int LEDR = 5;
int LEDG = 18;
int LEDB = 19;
String inputString = "";
boolean stringComplete = false;
void setup() {
My_LCD.begin(16, 2);
pinMode(buzzer, OUTPUT);
pinMode(LEDR, OUTPUT);
pinMode(LEDG, OUTPUT);
pinMode(LEDB, OUTPUT);
}
int r = 0;
int g = 0;
int b = 0;
void loop() {
//LCD
s=s+1;
if(s==60){
m=m+1;
s=0;
}
if(m==60){
m=0;
h=h+1;
}
My_LCD.print("HOURS=");
My_LCD.print(h);
My_LCD.setCursor(10,0);
My_LCD.print("MIN=");
My_LCD.print(m);
My_LCD.setCursor(0,1);
My_LCD.print("SEC=");
My_LCD.print(s);
delay(1000);
My_LCD.clear();
//ALARM
if((h == alarmH) && (m == alarmMin) && (alarmSec == s)){
tone(buzzer, 500);
delay(1000);
noTone(buzzer);
}
//LED
}
void RGB(int LEDR, int LEDG, int LEDB)
{
analogWrite(LEDR, 0);
analogWrite(LEDG, 201);
analogWrite(LEDB, 204);
delay(1000);
analogWrite(LEDR, 247);
analogWrite(LEDG, 120);
analogWrite(LEDB, 138);
delay(1000);
analogWrite(LEDR, 52);
analogWrite(LEDG, 168);
analogWrite(LEDB, 83);
delay(1000);
}