Go Down

Topic: DS1307 - Error compiler (Read 1 time) previous topic - next topic

Hallo,

I'm using the code from here: http://arduino-info.wikispaces.com/RTC

I get an error message:

In file included from ds1307_rtc.pde:17:
C:\Users\HTPC\Documents\Arduino\libraries\DS1307/DS1307.h:47: error: 'boolean' has not been declared
C:\Users\HTPC\Documents\Arduino\libraries\DS1307/DS1307.h:48: error: 'boolean' has not been declared
C:\Users\HTPC\Documents\Arduino\libraries\DS1307/DS1307.h:55: error: 'byte' does not name a type

Code: [Select]

35  void loop()
36  {
37 
38  Serial.print(RTC.get(DS1307_HR,true)); //read the hour and also update all the values by pushing in true
39  Serial.print(":");
40  Serial.print(RTC.get(DS1307_MIN,false));//read minutes without update (false)
41  Serial.print(":");
42  Serial.print(RTC.get(DS1307_SEC,false));//read seconds
43  Serial.print("      ");                 // some space for a more happy life
44  Serial.print(RTC.get(DS1307_DATE,false));//read date
45  Serial.print("/");
46  Serial.print(RTC.get(DS1307_MTH,false));//read month
47  Serial.print("/");
48  Serial.print(RTC.get(DS1307_YR,false)); //read year
49  Serial.println();
50
51  delay(1000);
52
53  }
I'm deaf.

www.christian-elektronik.de

robtillaart


Which version of the Arduino IDE are you using?
is the version of the lib found there compatible be it?

You can try to replace the keyword boolean with the keyword bool in the library as a quick fix .
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Quote
Which version of the Arduino IDE are you using?

Arduino 1.0.3

now one problem:

In file included from DS1307.cpp:3:
C:\Dokumente und Einstellungen\Keller-PC\Desktop\Arduino\libraries\DS1307/DS1307.h:55: error: 'byte' does not name a type

DS1307.h
Code: [Select]

41 // library interface description
42 class DS1307
43 {
44  // user-accessible "public" interface
45  public:
46    DS1307();
47    void get(int *, boolean);
48    int get(int, boolean);
49 void set(int, int);
50    void start(void);
51    void stop(void);
52
53  // library-accessible "private" interface
54  private:
55    byte rtc_bcd[7]; // used prior to read/set ds1307 registers;
56 void read(void);
57 void save(void);
58 };
I'm deaf.

www.christian-elektronik.de

SurferTim

Try replacing byte with uint8_t.
Code: [Select]
uint8_t rtc_bcd[7];


PaulS

Quote
In file included from ds1307_rtc.pde:17:

Quote
Arduino 1.0.3

These statements do not go together.

On the site you linked to, there are two versions of the library - a pre-1.0 version and a post 1.0 version. Which did you download?

Which version of the IDE are you really using?

Go Up