Pages: 1 ... 8 9 [10]   Go Down
Author Topic: Time Library added to Playground  (Read 36155 times)
0 Members and 1 Guest are viewing this topic.
Singapore
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Something else is causing your problem. Are you quite sure that the Time library folder location is  correct and that all the files are there?

I don't use OS X, perhap someone that does can check if they have any problems compiling the Time library example sketches.

I also have the same problem as SeanC.
I'm running Mac OS X 10.6.5 and Arduino 0021 on my machine.

I downloaded Time library and unzipped it under my Arduino/libraries directory.

Time library becomes available as example and also importing but I cannot compile the examples.

I get the following errors from TimeSerial example.

Code:
TimeSerial.cpp:12:20: error: Time.h: No such file or directory
TimeSerial:16: error: 'time_t' does not name a type
TimeSerial.cpp: In function 'void setup()':
TimeSerial:19: error: 'requestSync' was not declared in this scope
TimeSerial:19: error: 'setSyncProvider' was not declared in this scope
TimeSerial.cpp: In function 'void loop()':
TimeSerial:28: error: 'timeStatus' was not declared in this scope
TimeSerial:28: error: 'timeNotSet' was not declared in this scope
TimeSerial:30: error: 'timeSet' was not declared in this scope
TimeSerial.cpp: In function 'void digitalClockDisplay()':
TimeSerial:38: error: 'hour' was not declared in this scope
TimeSerial:39: error: 'minute' was not declared in this scope
TimeSerial:40: error: 'second' was not declared in this scope
TimeSerial:42: error: 'day' was not declared in this scope
TimeSerial:44: error: 'month' was not declared in this scope
TimeSerial:46: error: 'year' was not declared in this scope
TimeSerial.cpp: In function 'void processSyncMessage()':
TimeSerial:64: error: 'time_t' was not declared in this scope
TimeSerial:64: error: expected `;' before 'pctime'
TimeSerial:68: error: 'pctime' was not declared in this scope
TimeSerial:71: error: 'pctime' was not declared in this scope
TimeSerial:71: error: 'setTime' was not declared in this scope
TimeSerial.cpp: At global scope:
TimeSerial:76: error: 'time_t' does not name a type

Any suggestions on how to get Time library to work?
« Last Edit: November 25, 2010, 07:33:41 am by takashiyoshida » Logged

Singapore
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually, I just figured out what I was doing wrong.

When I installed Time library at my libraries directory, I did it like this:

I unzipped Time.zip file at my libraries directory, so it created a new directory, 'Time'.

So the result was like this:
Code:
~/Documents/Arduino/libraries/Time/DS1307RTC
~/Documents/Arduino/libraries/Time/Time
~/Documents/Arduino/libraries/Time/TimeAlarms

Instead, what I should have done was to move the contents of top-level 'Time' directory to my libraries directory, like this:

Code:
~/Documents/Arduino/libraries//DS1307RTC
~/Documents/Arduino/libraries/Time/
~/Documents/Arduino/libraries/TimeAlarms

After making this adjustment, I am able to compile the examples that came with Time library. Hope other people may find it useful (or has everyone already figured this out?).
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6255
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good to hear you have it working.

I hope that information helps others with a similar problem
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am trying to use the Ethernet shield, and NTP but I'm having problems with the examples out of the box, with the following errors:


heating01.cpp.o: In function `write_n(int, int)':
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:133: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:133: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:133: undefined reference to `UdpBytewiseClass::write(unsigned char)'
heating01.cpp.o: In function `getUlong()':
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:123: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:123: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:123: undefined reference to `UdpBytewiseClass::read()'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:124: undefined reference to `UdpBytewiseClass::read()'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:125: undefined reference to `UdpBytewiseClass::read()'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:126: undefined reference to `UdpBytewiseClass::read()'
heating01.cpp.o: In function `sendNTPpacket(unsigned char*)':
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:106: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:106: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:106: undefined reference to `UdpBytewiseClass::begin(unsigned int)'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:107: undefined reference to `UdpBytewiseClass::beginPacket(unsigned char*, unsigned int)'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:108: undefined reference to `UdpBytewiseClass::write(unsigned char)'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:109: undefined reference to `UdpBytewiseClass::write(unsigned char)'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:110: undefined reference to `UdpBytewiseClass::write(unsigned char)'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:111: undefined reference to `UdpBytewiseClass::write(unsigned char)'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:113: undefined reference to `UdpBytewiseClass::write(unsigned char)'
heating01.cpp.o:C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:114: more undefined references to `UdpBytewiseClass::write(unsigned char)' follow
heating01.cpp.o: In function `sendNTPpacket(unsigned char*)':
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:118: undefined reference to `UdpBytewiseClass::endPacket()'
heating01.cpp.o: In function `getNtpTime()':
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:95: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:95: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:95: undefined reference to `UdpBytewiseClass::available()'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:97: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:97: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:97: undefined reference to `UdpBytewiseClass::read()'

Having spent most of the day searching I've turned up nout.. Any help appreciated!

Stuart, newbie..
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6255
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

you didn't say if if you installed the UdpBytewise library, you can find a link and some updates in this thread: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1284070155
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for your reply,
I've re-downloaded all the files shown on http://bitbucket.org/bjoern/arduino_osc/src/14667490521f/libraries/Ethernet/

Errors now look like this:
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:30:19: error: types.h: No such file or directory
In file included from C:\Users\Stuart\Downloads\arduino-0021\libraries\SPI/SPI.h:15,
                 from C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\utility/w5100.h:14,
                 from C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:31:
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:17: error: declaration of C function 'uint16_t makeWord(byte, byte)' conflicts with
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:16: error: previous declaration 'uint16_t makeWord(uint16_t)' here
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:27: error: declaration of C function 'long int random(long int)' conflicts with
c:/users/stuart/downloads/arduino-0021/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:504: error: previous declaration 'long int random()' here
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:28: error: declaration of C function 'long int random(long int, long int)' conflicts with
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:27: error: previous declaration 'long int random(long int)' here
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp: In member function 'void UdpBytewiseClass::begin(uint16_t)':
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:46: error: 'Sn_MR_UDP' was not declared in this scope
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp: In member function 'int UdpBytewiseClass::available()':
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:55: error: 'getSn_RX_RSR' was not declared in this scope

So still a little stumped, but learning fast..
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6255
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Stuart, those messages look similar to the ones in the thread linked in my previous post. Did you try the change suggested in that thread?

As this looks like an issue with the ethernet  code and not the time library lets continue the discussion to that thread:  http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1284070155
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This has probably already been mentioned, but after wasting a couple hours i feel its worth saying.

The DS1307 RTC wont work off the usb power (going though arduino's 5v reg which would result in a drop).

I prolly should have realised it was power sooner, but oh well.
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6255
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@GhostGum, perhaps it was a problem with your wiring, a DS1307 will run fine off 5 volts from USB.
Logged

left coast
Offline Offline
Newbie
*
Karma: 0
Posts: 1
bitshifts and blinkies
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is there any particular interest in having the DS3231 specific features (such as forcing a temperature conversion, reading the temperature value, toggling the 32KHz pin, etc) added? I've already got the first two there finished, although I can't actually test them.

I'm using a chronodot (DS3231 breakout) with the DS1307 library and it works fine.  I'm not doing anything fancy like mentioned above, but for basic functionality the existing code works.

-w15p
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Whats the way to get the clock from the PC using vb 2008 through the serial port ? is there a simple function for that ? :-/
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

After reading more of the previous posts i understood the NewTimeSerial.pde
 code , and Thank you [size=12]mem[/size]  You are a great person,
now i will try to send the time from vb  ;D
Logged

USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 78
ClockTHREE Rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

mem,
Thanks for posting this code.  I've added a couple of macros you may want to consider including to Time.h:
Code:
#define DAYS_PER_YEAR(_year_) (365 + LEAP_YEAR(_year_))
#define SECS_PER_YEAR(_year_) ((DAYS_PER_YEAR(_year_)) * SECS_PER_DAY)

This should be backward compatible.

Thanks again,
Justin
Logged

Pages: 1 ... 8 9 [10]   Go Up
Jump to: