Hi, after updating Arduino to 1.6.10 when compiling the same code I obtain the error
setTime' was not declared in this scope
How I can fix it?
Hi, after updating Arduino to 1.6.10 when compiling the same code I obtain the error
setTime' was not declared in this scope
How I can fix it?
How I can fix it?
Don't call functions that aren't defined.
Post your code (ALL of it) and the EXACT error message(s).
The code is too big to paste all, so I extract the block when the error is found:
#include <SimpleTimer.h>
#include <Time.h>
#include <Wire.h>
#include "RTClib.h"
#include <avr/wdt.h>
RTC_DS1307 DS1307;
void setup () {
Wire.begin();
if (! DS1307.begin()) {
debugMillis(F("Couldn't find RTC!"), "", false, false);
} else {
debugMillis(F("RTC found."), "", false, false);
DateTime cTime = DS1307.now();
setTime(cTime.hour(), cTime.minute(), cTime.second(), cTime.day(), cTime.month(), cTime.year());
debugMillis("Time synced with RTC: ", stringTime(), false, false);
}
}
... and the error is ...
C:\Users\Igor\Documents\Arduino\myReef2_Mega\myReef2_Mega.ino: In function 'void setup()':
myReef2_Mega:769: error: 'setTime' was not declared in this scope
setTime(cTime.hour(), cTime.minute(), cTime.second(), cTime.day(), cTime.month(), cTime.year());
Nope, I'm trying to call the class Time.h
Before upgrading to Arduino 1.6.10 and the relative libraries all works good... uhm...
The Time library works better if you #include <TimeLib.h> instead of <Time.h>.
(Time.h contains just that one #include.)
#include <TimeLib.h>
In your time library folder there should be three files
Time.cpp
Time.h
TimeLib.h
oqibidipo:
The Time library works better if you #include <TimeLib.h> instead of <Time.h>.
(Time.h contains just that one #include.)
Yesssss!!! This was the problem! Thankssss!
me to i have the same erreur i do not know to do
I have some simmilar problems , could you help me please?
the message error is as follows
Arduino:1.8.1 (Windows 7), Tarjeta:"Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
In file included from C:\Users\MAO\Documents\Arduino\ejemplo_timer\ejemplo_timer.ino:6:0:
C:\Users\MAO\Documents\Arduino\libraries\TimeAlarms/TimeAlarms.h:71:31: error: 'timeDayOfWeek_t' does not name a type
AlarmID_t alarmRepeat(const timeDayOfWeek_t DOW, const int H, const int M, const int S, OnTick_t onTickHandler); // as above, with day of week
^
C:\Users\MAO\Documents\Arduino\libraries\TimeAlarms/TimeAlarms.h:75:29: error: 'timeDayOfWeek_t' does not name a type
AlarmID_t alarmOnce(const timeDayOfWeek_t DOW, const int H, const int M, const int S, OnTick_t onTickHandler); // as above, with day of week
^
C:\Users\MAO\Documents\Arduino\ejemplo_timer\ejemplo_timer.ino: In function 'void setup()':
ejemplo_timer:23: error: 'setTime' was not declared in this scope
setTime(now.hour(), now.minute(), now.second(), now.month(), now.day(), now.year());
^
C:\Users\MAO\Documents\Arduino\ejemplo_timer\ejemplo_timer.ino: In function 'void digitalClockDisplay()':
ejemplo_timer:72: error: 'hour' was not declared in this scope
Serial.print(hour());
^
ejemplo_timer:73: error: 'minute' was not declared in this scope
printDigits(minute());
^
ejemplo_timer:74: error: 'second' was not declared in this scope
printDigits(second());
^
Se encontraron múltiples librerías para "Wire.h"
Usado: C:\Program Files\Arduino\hardware\arduino\avr\libraries\Wire
No usado: C:\Users\MAO\Documents\Arduino\libraries\Wire
exit status 1
'setTime' was not declared in this scope
Would it be stating the bleedin' obvious to point out that you haven't posted your code?
It would?
Too bad.
Arduino: 1.8.3 (Windows 7), Board: "Arduino/Genuino Uno"
C:\Users\soe wonna\Downloads\arduinosketch\arduinosketch.ino: In function 'void loop()':
arduinosketch:170: error: 'now' was not declared in this scope
startTime = now();
^
arduinosketch:281: error: 'now' was not declared in this scope
currentTime = setupTime - (now() - startTime);
^
arduinosketch:337: error: 'hour' was not declared in this scope
if(hour(currentTime) < 10) lcd.print("0");
^
arduinosketch:338: error: 'hour' was not declared in this scope
lcd.print(hour(currentTime));
^
arduinosketch:340: error: 'minute' was not declared in this scope
if(minute(currentTime) < 10) lcd.print("0");
^
arduinosketch:341: error: 'minute' was not declared in this scope
lcd.print(minute(currentTime));
^
arduinosketch:343: error: 'second' was not declared in this scope
if(second(currentTime) < 10) lcd.print("0");
^
arduinosketch:344: error: 'second' was not declared in this scope
lcd.print(second(currentTime));
^
Multiple libraries were found for "LiquidCrystal.h"
Used: C:\Program Files\Arduino\libraries\LiquidCrystal
Not used: C:\Users\soe wonna\Documents\Arduino\libraries\NewliquidCrystal
exit status 1
'now' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
@wonna: see reply #11
i have a similar problem, i have download the #include <TIMElib.h>, but i still get the error message that 'currentTIME' can not be used as a function.
Fonkwe:
i have a similar problem, i have download the #include <TIMElib.h>, but i still get the error message that 'currentTIME' can not be used as a function.
I expect you're doing something wrong in the code that you haven't shown us.
Steve