Pages: [1]   Go Down
Author Topic: DS1307 - Error compiler  (Read 1530 times)
0 Members and 1 Guest are viewing this topic.
Germany
Offline Offline
Jr. Member
**
Karma: 1
Posts: 55
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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  }
Logged


Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13739
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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 .
Logged

Rob Tillaart

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

Germany
Offline Offline
Jr. Member
**
Karma: 1
Posts: 55
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

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 };
Logged


Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 147
Posts: 6038
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 615
Posts: 49411
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Pages: [1]   Go Up
Jump to: