Sponge Bob
Sponge Bob

Reputation: 1621

How do you include time_t on an Arduino?

I am trying to compile and upload one of the example WiFly projects to my Arduino. One of the example's functions is has return-type 'time_t', but the compiler doesn't recognize that. I have tried including both <ctime> and <time.h>.

This is my first time really using C++, So how do I import 'time_t' on my Arduino?

Upvotes: 2

Views: 16658

Answers (2)

spuder
spuder

Reputation: 18477

If you download the Time library it gets a .zip file that has 3 folders. TimeAlarms, Time and DS1307RTC. Try moving these 3 folders out of the Time folder, and directly into the libraries folder.

See the comment on November 14, 2012 at 5:09 http://adventuresinarduinoland.blogspot.com/2012/09/yet-another-real-time-clock.html

Upvotes: 0

user7116
user7116

Reputation: 64118

Apparently you'll need to do two things to use time_t on your Arduino.

  1. Download the Time Library
  2. Include <Time.h> (note the capital T)

Upvotes: 3

Related Questions