hello guys
i setting alarms in arduino using ds1307rtc seems not able compile it
here sketch
here error
can u guys pls point me out might problem
i setting alarms in arduino using ds1307rtc seems not able compile it
here sketch
code: [select]
/*
#include <time.h>
#include <timealarms.h>
#include <wire.h> //added jim ************************
#include <ds1307rtc.h> //added jim ***************************
void setup()
{
serial.begin(9600);
serial.println("in setup...."); //added jim *****************
/*
using rtc, sync system time rtc
settime(8,29,0,1,1,11); // set time saturday 8:29:00am jan 1 2011 //old way *****************
*/
// following lines added set time rtc, took timertcset example, added jim *****************
setsyncprovider(rtc.get); // function time rtc
if (timestatus() != timeset)
serial.println("unable sync rtc");
else
serial.println("rtc has set system time");
// end of setting time ******************************
// create alarms
alarm.alarmrepeat(11, 30, 30,led13off);
alarm.alarmrepeat(11, 30, 00,led13on);
//alarm.alarmrepeat(11,16,0, morningalarm);
/*
alarm.alarmrepeat(10, 35,45, morningalarm);
alarm.alarmrepeat(10,36,0, morningalarm);
alarm.alarmrepeat(10, 36,30, morningalarm);
alarm.alarmrepeat(10,37,0, morningalarm);
alarm.alarmrepeat(10, 15,30, morningalarm);
alarm.alarmrepeat(10,16,0, morningalarm);
alarm.alarmrepeat(10,16,30, morningalarm);
alarm.alarmrepeat(10,17,0, morningalarm);
alarm.alarmrepeat(10, 17,30, morningalarm);
alarm.alarmrepeat(17,45,0,eveningalarm); // 5:45pm every day
alarm.alarmrepeat(dowsaturday,8,30,30,weeklyalarm); // 8:30:30 every saturday
*/
//alarm.timerrepeat(15, repeats); // timer every 15 seconds
//alarm.timeronce(10, onceonly); // called once after 10 seconds
pinmode(13, output);
digitalwrite(13, low);
serial.print("turning pin 13 led off @ ");
digitalclockdisplay();
serial.println("ending setup...."); //added jim *****************
}
void loop(){
digitalclockdisplay();
alarm.delay(1000);
}
// functions called when alarm triggers:
void led13on(){
//serial.print("turning pin 13 led on @ ");
//digitalclockdisplay();
digitalwrite(13, high);
}
void led13off(){
//serial.print("turning pin 13 led off @ ");
//digitalclockdisplay();
digitalwrite(13, low);
}
void morningalarm(){
digitalclockdisplay();
serial.println("alarm: - turn lights off jimbo");
}
void eveningalarm(){
serial.println("alarm: - turn lights on");
}
void weeklyalarm(){
serial.println("alarm: - monday morning");
}
void explicitalarm(){
serial.println("alarm: - triggers @ given date , time");
}
void repeats(){
serial.println("15 second timer");
}
void onceonly(){
serial.println("this timer triggers once");
}
void digitalclockdisplay()
{
// digital clock display of time
serial.print(hour());
printdigits(minute());
printdigits(second());
serial.println();
}
void printdigits(int digits)
{
serial.print(":");
if(digits < 10)
serial.print('0');
serial.print(digits);
}
here error
code: [select]
report have more information with
"show verbose output during compilation"
enabled in file > preferences.
arduino: 1.0.6 (windows nt (unknown)), board: "arduino uno"
in file included sketch_may08a.ino:13:
c:\users\saif\documents\arduino\libraries\ds1307rtc/ds1307rtc.h:17: error: 'time_t' not name type
c:\users\saif\documents\arduino\libraries\ds1307rtc/ds1307rtc.h:18: error: 'time_t' has not been declared
c:\users\saif\documents\arduino\libraries\ds1307rtc/ds1307rtc.h:19: error: 'tmelements_t' has not been declared
c:\users\saif\documents\arduino\libraries\ds1307rtc/ds1307rtc.h:20: error: 'tmelements_t' has not been declared
sketch_may08a.ino: in function 'void setup()':
sketch_may08a:25: error: 'class ds1307rtc' has no member named 'get'
sketch_may08a:25: error: 'setsyncprovider' not declared in scope
sketch_may08a:26: error: 'timestatus' not declared in scope
sketch_may08a:26: error: 'timeset' not declared in scope
sketch_may08a:35: error: 'alarm' not declared in scope
sketch_may08a.ino: in function 'void loop()':
sketch_may08a:70: error: 'alarm' not declared in scope
sketch_may08a.ino: in function 'void digitalclockdisplay()':
sketch_may08a:116: error: 'hour' not declared in scope
sketch_may08a:117: error: 'minute' not declared in scope
sketch_may08a:118: error: 'second' not declared in scope
can u guys pls point me out might problem
that first line looks awfully suspicious. i suggest removing it.
code: [select]
/* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
#include <time.h>
#include <timealarms.h>
#include <wire.h> //added jim ************************
#include <ds1307rtc.h> //added jim ***************************
void setup()
{
...
Arduino Forum > Using Arduino > Programming Questions > Cant compile the code
arduino
Comments
Post a Comment