Go Down

Topic: Time Libraries (Read 1 time) previous topic - next topic

be80be

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.



robtillaart

replace BYTE with uint8_t in the libs
Rob Tillaart

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

Jack Christensen


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.
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

be80be

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.


be80be

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

PaulS

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

be80be

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: [Select]
Serial.write( TIME_HEADER);
Now for next problem
Code: [Select]
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

be80be

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

Code: [Select]
time = millis(); to fix it

danb35


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.

Go Up