Can anyone advise me on this problem? I am trying to print a float value onto a UTFT screen. After reading several articles which all say to use dtostrf() and use the avr-libc library, I have tried this but cannot get any joy.
#include <AVR_RTC.h>
#include <time.h>
#include <UTFT.h>
UTFT myGLCD(SSD1289, 38, 39, 40, 41);
extern uint8_t BigFont[];
int Htime; //integer for storing high time
int Ltime; //integer for storing low time
int long Ttime; // integer for storing total time of a cycle
float frequency; //storing frequency
String DisplayFreq;
void setup()
{
pinMode(A0,INPUT);
Serial.begin(9600);
myGLCD.InitLCD();
myGLCD.clrScr();
}
void loop()
{
myGLCD.clrScr();
myGLCD.print("Frequency of signal",CENTER, 20);
Htime=pulseIn(A0,HIGH); //read high time
Ltime=pulseIn(A0,LOW); //read low time
Ttime = Htime+Ltime;
frequency=1000000/Ttime; //getting frequency with Ttime is in Micro seconds
dtostrf(frequency,7, 3, DisplayFreq);
myGLCD.print(DisplayFreq, CENTER, 40);
myGLCD.print(" Hz",RIGHT,40);
delay(500);
}
I get this error
fatal error: util/atomic.h: No such file or directory #include <util/atomic.h>
So the problem is in line 6 of a file in the AVR_Standard_C_Time_Library library you installed. Perhaps that library wasn't tested on the DUE? Maybe you can find a different library for your RTC hardware.