For the life of me I can't figure out why this sketch will not compile.
I'm sure the problem is in these lines.
int time();
or
time = ((now.hour * 60) + now.second);
When verifying sketch I get the error, "invalid use of member (did youforget the '&'?)
Any help would be great. Thanks!
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib
#include <Wire.h>
#include "RTClib.h"
RTC_DS1307 RTC;
int time();
void setup () {
Serial.begin(9600);
Wire.begin();
RTC.begin();
//if (! RTC.isrunning())
{
Serial.println("RTC is NOT running!");
// following line sets the RTC to the date & time this sketch was compiled
RTC.adjust(DateTime(__DATE__, __TIME__));
}
}
void loop () {
DateTime now = RTC.now();
time = ((now.hour * 60) + now.second);
if(now.hour = 0){ //0th hour
if((3450 <= time < 3549)||(0 <= time < 150)){
Serial.println("TWELVE O'CLOCK");
}
if(150 <= time < 450){
Serial.println("FIVE PAST TWELVE");
}
if(450 <= time < 750){
Serial.println("TEN PAST TWELVE");
}
if(750 <= time < 1050){
Serial.println("QUARTER PAST TWELVE");
}
if(1050 <= time < 1350){
Serial.println("TWENTY PAST TWELVE");
}
if(1350 <= time < 1650){
Serial.println("TWENTY FIVE PAST TWELVE");
}
if(1650 <= time < 1950){
Serial.println("HALF PAST TWELVE");
}
if(1950 <= time < 2250){
Serial.println("TWENTY FIVE 'TILL TWELVE");
}
if(2250 <= time < 2550){
Serial.println("TWENTY 'TILL TWELVE");
}
if(2550 <= time < 2850){
Serial.println("QUARTER 'TILL TWELVE")
}
if(2850 <= time < 3150){
Serial.println("TEN 'TILL TWELVE");
}
if(3150 <= time < 3450){
Serial.println("FIVE 'TILL TWELVE");
}
}