I am trying to make an RTC3231 work and I can't get the basic stuff to work.
Here is the code:
#include "arduino.h"
#include "Wire.h"
#include "Time.h"
#include "DS3231.h"
DS3231RTC RTC3231;
tmElements_t tm;
void setup()
{
Serial.begin(9600);
tm.Year=2013 - 1970;
tm.Month = 7;
tm.Day = 30;
tm.Hour= 19;
tm.Minute = 57;
tm.Second = 0;
// RTC3231.write(tm);
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()
{
Serial.print("Temp: ");Serial.print(RTC3231.getTemp()*1.8+32); Serial.println();
Serial.print("Time: ");
Serial.print(month()); Serial.print(" ");
Serial.print(day()); Serial.print(" ");
Serial.print(year()); Serial.print(" ");
Serial.print(hour()); Serial.print(" ");
Serial.print(minute()); Serial.print(" ");
Serial.print(second()); Serial.print(" ");
Serial.println();
delay(1000);
}
Here are the errors:
clock_test2:7: error: 'DS3231RTC' does not name a type
clock_test2.ino: In function 'void setup()':
clock_test2:20: error: 'RTC' was not declared in this scope
clock_test2.ino: In function 'void loop()':
clock_test2:30: error: 'RTC3231' was not declared in this scope
I have created WProgram.h and it has the single include line for arduino.h
I am using the Iteaduino 2.2 board for this project. And I am running 1.0.5 of the Arduino app in windows 7. And yes, I am very new to Arduino and programming in general. I have worked through many examples and am well on my way to building a freshwater aquarium controller, but need the clock to work!
Thanks Matt