problem running RTC DS1302


hi,

i'm beginner in arduino , programming society , i'm having problems running ds1302 rtc module. i'm using ds1302_serial_easy library. can't figure out what's causing issue. google search gave no solution. so, hope can tackle problem.

i'm getting error feedback :

sketch_aug19a:15: error: 'ds1302' not name type
sketch_aug19a.ino: in function 'void setup()':
sketch_aug19a:20: error: 'rtc' not declared in scope
sketch_aug19a:27: error: 'friday' not declared in scope
sketch_aug19a.ino: in function 'void loop()':
sketch_aug19a:35: error: 'rtc' not declared in scope

the code itself:

// ds1302_serial_easy (c)2010 henning karlsen
// web: http://www.henningkarlsen.com/electronics
//
// quick demo of how use ds1302-library
// send time , date information on serial link
//
// assume know how connect ds1302.
// ds1302:  ce pin    -> arduino digital 2
//          i/o pin   -> arduino digital 3
//          sclk pin  -> arduino digital 4

#include <ds1302.h>

// init ds1302
ds1302 rtc(2, 3, 4);

void setup()
{
  // set clock run-mode, , disable write protection
  rtc.halt(false);
  rtc.writeprotect(false);
 
  // setup serial connection
  serial.begin(9600);

  // following lines can commented out use values stored in ds1302
  rtc.setdow(friday);        // set day-of-week friday
  rtc.settime(12, 0, 0);     // set time 12:00:00 (24hr format)
  rtc.setdate(6, 8, 2010);   // set date august 6th, 2010
}

void loop()
{
  // send day-of-week
  serial.print(rtc.getdowstr());
  serial.print(" ");
 
  // send date
  serial.print(rtc.getdatestr());
  serial.print(" -- ");

  // send time
  serial.println(rtc.gettimestr());
 
  // wait 1 second before repeating :)
  delay (1000);
}

thank's :)

you sure library's in right place? i've used often.

it can unzip 1 level away it's supposed be.....


Arduino Forum > Using Arduino > Programming Questions > problem running RTC DS1302


arduino

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support