I have a lot of Arduino sketches and libraries installed. All was working quite smoothly with no errors for many months.
Then I installed the Teensyarduino on Arduino 1.8.1. Installation went smoothly with no errors.
Now, I get an error trying to compile the most basic TIME example.
EXAMPLE/TIME/TIMERTC
I get the following error trying to compile...
'setSyncProvider' was not declared in this scope.
I have listed the code below, but it is the basic unmodified example code.
I figure I have a library problem somewhere, somehow. I have tried to reload the time library with no change.
I can not be the first with this issue. Any help most appreciated.
Cheers.
/*
* TimeRTC.pde
* Example code illustrating Time library with Real Time Clock.
* This example is identical to the example provided with the Time Library,
* only the #include statement has been changed to include the DS3232RTC library.
*/
#include <DS3232RTC.h> //http://github.com/JChristensen/DS3232RTC
#include <Time.h> //http://www.arduino.cc/playground/Code/Time
#include <Wire.h> //http://arduino.cc/en/Reference/Wire (included with Arduino IDE)
void setup(void)
{
Serial.begin(9600);
setSyncProvider(RTC.get); // the function to get the time from the RTC
if(timeStatus() != timeSet)
Serial.println("Unable to sync with the RTC");
else
Serial.println("RTC has set the system time");
}
void loop(void)
{
digitalClockDisplay();
delay(1000);
}
void digitalClockDisplay(void)
{
// digital clock display of the time
Serial.print(hour());
printDigits(minute());
printDigits(second());
Serial.print(' ');
Serial.print(day());
Serial.print(' ');
Serial.print(month());
Serial.print(' ');
Serial.print(year());
Serial.println();
}
void printDigits(int digits)
{
// utility function for digital clock display: prints preceding colon and leading 0
Serial.print(':');
if(digits < 10)
Serial.print('0');
Serial.print(digits);
}
Then I installed the Teensyarduino on Arduino 1.8.1. Installation went smoothly with no errors.
Now, I get an error trying to compile the most basic TIME example.
EXAMPLE/TIME/TIMERTC
I get the following error trying to compile...
'setSyncProvider' was not declared in this scope.
I have listed the code below, but it is the basic unmodified example code.
I figure I have a library problem somewhere, somehow. I have tried to reload the time library with no change.
I can not be the first with this issue. Any help most appreciated.
Cheers.
/*
* TimeRTC.pde
* Example code illustrating Time library with Real Time Clock.
* This example is identical to the example provided with the Time Library,
* only the #include statement has been changed to include the DS3232RTC library.
*/
#include <DS3232RTC.h> //http://github.com/JChristensen/DS3232RTC
#include <Time.h> //http://www.arduino.cc/playground/Code/Time
#include <Wire.h> //http://arduino.cc/en/Reference/Wire (included with Arduino IDE)
void setup(void)
{
Serial.begin(9600);
setSyncProvider(RTC.get); // the function to get the time from the RTC
if(timeStatus() != timeSet)
Serial.println("Unable to sync with the RTC");
else
Serial.println("RTC has set the system time");
}
void loop(void)
{
digitalClockDisplay();
delay(1000);
}
void digitalClockDisplay(void)
{
// digital clock display of the time
Serial.print(hour());
printDigits(minute());
printDigits(second());
Serial.print(' ');
Serial.print(day());
Serial.print(' ');
Serial.print(month());
Serial.print(' ');
Serial.print(year());
Serial.println();
}
void printDigits(int digits)
{
// utility function for digital clock display: prints preceding colon and leading 0
Serial.print(':');
if(digits < 10)
Serial.print('0');
Serial.print(digits);
}