if ((temperatura) < 22.5)
Why are there parentheses around tempartatura?
How do I get is drawn only one pixel for each value of the buf
You have several problems. First, and foremost:
char buf[7];
defines an array that can hold 7 characters.
while ((n = file.read(buf, sizeof(buf))) > 0)
sizeof(buf), therefore, returns 7, so you are asking the file.read() function to move 7 characters into buf.
The records in the file are arranged in a stream, containing
nn.nnnn.nnnn.nn...
So, for the first call, you are asking for "nn.nnn" to be read. Then, you are asking for "n.nnnn". Then, "nnnn.".
It should be apparent that this is NOT what you want to do. If you are absolutely positive that there will always be exactly two characters, a decimal point, exactly 2 characters, a carriage return and a line feed, in repeating patterns, then hardcode a length of 7 for the number of bytes to read. Do NOT make it a function of the size of the array.
Then, make the array large enough to those 7 characters (it already is, so this is handled).
Finally, make the array be NULL terminated, by replacing the carriage return (the 6th value read) with a NULL.
buf[5] = '\0';
Now, you have a string, which is what the atof() function expects.
Then, you have this:
hora = (t.hour*60)+t.min;
I have no idea what t is, but there is no other code that references t, so the value of t.hour and t.min do not change while you are reading the file, so the value of hora never changes. Therefore, this code belongs before the while loop that reads the file.
Finally, you have
for (uint8_t j=0; j <=(hora/6) ;j++)
{
setFont(SMALL, 255, 0, 255, 0, 0, 0);
myGLCD.drawPixel((40+j),grafico);
}
Which draws a line by lighting up a series of pixels. If your goal is to light just one pixel, why is the drawPixel() function called in a loop?