I recently setup the Arduino IDE v 1.0.5 along with the newest version of Teensyduino downloaded from PJRC in Ubuntu 12.04. My program (in fact, many versions of the program) which had compiled just fine (also in Ubuntu 12.04) before now gives me the following error:
I'm using the following libraries.
#include <SdFat.h>
#include <SdFatUtil.h> // use functions to print strings from flash memory
#include <Time.h> // enable real time clock library
#include <Wire.h>
#include <DS1307RTC.h> // a basic DS1307 library that returns time as a atime_t
#include <PITimer.h>
It seems to be an issue with the Time.h and/or DS1307RTC library (which define atime_t), because I can run previous versions which used the SdFat and SdFatUtil without any problems. Time and DS1307 libraries come packaged with Teensy, and I've used those though I have also tried downloading new ones just in case. I've checked all the files in the Libraries folder and they look file, with the *.h file in the top of the directory (so it's definitely visible when Arduino searches for it).
Also, I know I need to switch from PITimer to IntervalTimer (it's on the list), but I don't think this error is due to that.
I ran TimeTeensy3 and TimeRTC examples and they worked fine, along with other standard examples (blink, etc.)
Here's the snippet of code (which I believe was originally from a time example I found somewhere):
Any ideas or similar problems?
Thanks,
Greg
Code:
Combined:78: error: 'atime_t' does not name a type
Combined.ino: In function 'void setup()':
Combined:177: error: invalid conversion from 'long unsigned int (*)()' to 'getExternalTime {aka long int (*)()}' [-fpermissive]
In file included from Combined.ino:47:0:
/home/photosynq/Desktop/arduino-1.0.5/libraries/Time/Time.h:134:9: error: initializing argument 1 of 'void setSyncProvider(getExternalTime)' [-fpermissive]
Combined:195: error: 'atime_t' was not declared in this scope
Combined:195: error: expected ';' before 't'
Combined:197: error: 't' was not declared in this scope
Combined.ino: At global scope:
Combined:1486: error: 'atime_t' does not name a type
I'm using the following libraries.
#include <SdFat.h>
#include <SdFatUtil.h> // use functions to print strings from flash memory
#include <Time.h> // enable real time clock library
#include <Wire.h>
#include <DS1307RTC.h> // a basic DS1307 library that returns time as a atime_t
#include <PITimer.h>
It seems to be an issue with the Time.h and/or DS1307RTC library (which define atime_t), because I can run previous versions which used the SdFat and SdFatUtil without any problems. Time and DS1307 libraries come packaged with Teensy, and I've used those though I have also tried downloading new ones just in case. I've checked all the files in the Libraries folder and they look file, with the *.h file in the top of the directory (so it's definitely visible when Arduino searches for it).
Also, I know I need to switch from PITimer to IntervalTimer (it's on the list), but I don't think this error is due to that.
I ran TimeTeensy3 and TimeRTC examples and they worked fine, along with other standard examples (blink, etc.)
Here's the snippet of code (which I believe was originally from a time example I found somewhere):
Code:
/* code to process time sync messages from the serial port */
#define TIME_MSG_LEN 11 // time sync to PC is HEADER followed by unix atime_t as ten ascii digits
#define TIME_HEADER 'T' // Header tag for serial time sync message
atime_t processSyncMessage() {
// return the time if a valid sync message is received on the serial port.
while(Serial.available() >= TIME_MSG_LEN ){ // time message consists of a header and ten ascii digits
char c = Serial.read() ;
Serial.print(c);
if(c == TIME_HEADER ) {
atime_t pctime = 0;
for(int i=0; i < TIME_MSG_LEN -1; i++){
c = Serial.read();
if( c >= '0' && c <= '9'){
pctime = (10 * pctime) + (c - '0') ; // convert digits to a number
}
}
return pctime;
Serial.println("this is pc time");
Serial.println(pctime);
}
}
return 0;
i=0; // reset i
}
Any ideas or similar problems?
Thanks,
Greg