Pages: [1]   Go Down
Author Topic: Time Libraries  (Read 1152 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
****
Karma: 3
Posts: 250
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was wanting to use the time libraries But they don't play nice with arduino 1.0.1 or 1.0.0
And the Date time libraries has byte used in the serial part which keeps it from working.

Here what I get
Quote
sketch_nov11a.cpp: In function 'void loop()':
sketch_nov11a:31: error: 'BYTE' was not declared in this scope

As of Arduino 1.0, the 'BYTE' keyword is no longer supported.
Please use Serial.write() instead.


And here the Time sample
Quote
TimeSerial.cpp: In function 'time_t requestSync()':
TimeSerial.pde:-1: error: 'BYTE' was not declared in this scope

As of Arduino 1.0, the 'BYTE' keyword is no longer supported.
Please use Serial.write() instead.


Logged

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

replace BYTE with uint8_t in the libs
Logged

Rob Tillaart

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

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4084
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

replace BYTE with uint8_t in the libs

Is the issue with the library or just with the example sketches? I've used the Time library with both 1.0.0 and 1.0.1, I don't think I remember having to do anything to the library itself.
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Offline Offline
Sr. Member
****
Karma: 3
Posts: 250
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well I just looked at the libraries for Date Time and there casting byte to uint8_t so that shouldn't be a problem

And Yes I'm trying the sample for Timeserial so it may be just the sample.

Logged

Offline Offline
Sr. Member
****
Karma: 3
Posts: 250
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well  just got done going over the file and this may be the cause of the problem
Code:
{
  Serial.print(TIME_REQUEST,BYTE); 
  return 0; // the time will be sent later in response to serial mesg
}
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 614
Posts: 49343
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Well  just got done going over the file and this may be the cause of the problem
That's the line that the compiler is telling you to change. It should be pretty simple to do so (at least with 1.0.2).
Logged

Offline Offline
Sr. Member
****
Karma: 3
Posts: 250
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok it should be simple but there not any thing that shows how to handle a byte.
Looks like it would be done this way
Code:
Serial.write( TIME_HEADER);
Now for next problem
Code:
C:\Documents and Settings\Burt\My Documents\Downloads\arduino-1.0.2-windows\arduino-1.0.2\libraries\DateTime\DateTime.cpp: In member function 'void DateTimeClass::setTime(time_t)':
C:\Documents and Settings\Burt\My Documents\Downloads\arduino-1.0.2-windows\arduino-1.0.2\libraries\DateTime\DateTime.cpp:28: error: 'millis' was not declared in this scope
C:\Documents and Settings\Burt\My Documents\Downloads\arduino-1.0.2-windows\arduino-1.0.2\libraries\DateTime\DateTime.cpp: In member function 'time_t DateTimeClass::now()':
C:\Documents and Settings\Burt\My Documents\Downloads\arduino-1.0.2-windows\arduino-1.0.2\libraries\DateTime\DateTime.cpp:43: error: 'millis' was not declared in this scope
Logged

Offline Offline
Sr. Member
****
Karma: 3
Posts: 250
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

While I think I found that to just need to figure where to put this

Code:
time = millis();
to fix it
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 107
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was wanting to use the time libraries
Which time library(ies)?  There are several.  This one: http://www.arduino.cc/playground/Code/Time has no problems with Arduino 1.0.1.
Logged

Pages: [1]   Go Up
Jump to: